views:

83

answers:

3

Hi

How to read and learn Execution plan of a T_SQL statement?

+1  A: 

If you're using SQL Server 2008, there's an option on the Query menu for "Include Execution Plan". This will display the query's execution plan after it has executed.

To learn more about how to enable the feature see: http://msdn.microsoft.com/en-us/library/ms178071.aspx

For more information about execution plans, what they are and how to use them, check out Grant Fritchey's article here: http://www.simple-talk.com/sql/performance/execution-plan-basics/

kdmurray
Impressive speed of typing...
gbn
thanks! :) I think I must have found the question immediately after posting... :P
kdmurray
+1  A: 

Execution Plan Basics on Simple-Talk

gbn
+1  A: 

When looking at the flow of it, see where the CPU usage is the most and if it is doing scans or seeks in that area. You should concentrate your efforts on the areas with the most CPU usage

Rule of thumb is that you want your query to do seeks as they are a lot more efficient that scans because they take advantage of indexes.

For the other things have a look at http://www.sql-server-performance.com/tips/query_execution_plan_analysis_p1.aspx . It gives a nice understanding of what you should be doing.

AutomatedTester