December 5, 2007 at 11:17 pm
Hi All,
I have written a query. Now i need to check whether the query is written in optimized way?
i'm using "show execution plan" tool to check the performance of query. what are the points should be noted in that plan,so that query is executing in optimized manner?
December 5, 2007 at 11:41 pm
Check for the performance hindering operations such as table scans, spools or bookmark/RID lookups.
--Ramesh
December 5, 2007 at 11:47 pm
See also execution plan.
December 5, 2007 at 11:59 pm
Thanks!!!
Could you able to explain the above points (table scan, BookMark etc.,) or is there any URL?
December 6, 2007 at 12:01 am
Keep in mind that both the estimated and actual execution plans can lie like a rug... if you have any form of a loop in your code or, sometimes, a UDF, you may never see the problem...
Same thing goes for any correlated sub-queries... only the plan and rowcount for the first row of execution will be displayed... something might look like you're handling 10,000 rows quite nicely in the estimated execution plan but, for things like triangular joins, the query could be spawing more than 50 million internal rows (that will many times show up in the actual execution plan)... kinda tough on performance when that happens.
Neither execution plan is the bible... it's just a guide. Real truth comes to bear when you run the code and measure the performance.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply