Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

execution plan takes a lot of time to generate?

Status
Not open for further replies.

TravisLaborde

IS-IT--Management
Nov 4, 2002
84
US
I have begun to notice, that for some queries, when I execute without the "show execution plan" option, the query takes 1, maybe 2 seconds to run, but it takes 20-30 seconds when I do have the "show execution plan" option enabled (in Query Analyzer).

Is this normal behavior? Is it indicating something I should be fixing?

Travis
 
Travis, when you select "Show Execution Plan", SQL is creating a graphic execution plan, complete with linked images, in the Execution Plan tab of the results window. If your code loops or is otherwise complex, SQL has to do a lot of drawing, and, yes, it will slow overall execution.

HTH,

Phil Hegedusich
Senior Web Developer
IIMAK
<a href=&quot;-----------
Boy howdy, my Liberal Studies degree really prepared me for all of this....
 
Travis,

You could look at it like this:

Pick a task you do each day (ie. Make a phone call)
Now make a phone call and time how long it takes to do that task.
Then do the same task, but DOCUMENT each step of the task as you do it. Include any 'pretty' pictures that might help explain how to make a phone call. Make sure you time how long this takes.

Show execution plan is like documenting a task as it's being done. Documentation always takes longer than just doing the task.

-SQLBill
 
I understand that the documentation would take longer... I was just wondering if the times I was seeing... 1-2 seconds compared to 30 or more seconds was something a bit over the edge, or very normal.

Since no one seems to be posting that it is strange, I'm guessing it's not.

Thanks!
Travis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top