December 9, 2007 at 5:14 am
The query executes very fast in Query Analyser while it takes almost 5 minutes in executing form VB
December 9, 2007 at 8:21 am
That's probably because when you execute it from VB, you're doing it as embedded SQL... which has no chance of reusing an Execution Plan.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 9, 2007 at 12:39 pm
I have seen this before and it is frustrating. Try a stored procedure and see if you can get it to behave better. Also, are you executing the same query, meaning same WHERE clause or parameters?
December 10, 2007 at 9:58 pm
The problem was solved when i changed connection from DSN to oledbProvider.
December 11, 2007 at 7:42 am
Very interesting. If you change it back, does it slow down again? Be interesting to know. Sounds like some kind of bug, but not sure it's worth chasing down.
December 11, 2007 at 1:56 pm
Depending on the syntax - an oleDB provider can execute the query client-side (or locally). That means you might be pulling a LOT of data only to have it excluded by the client execution of the WHERE clause.
Again - put it in a stored procedure, or if relevant - look at using something forcing remote or server-level execution, like the OPENQUERY syntax.
----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply