(SQL) Tip of the Day: Gathering SQL Execution Plans

Today’s (SQL) Tip…

Today we are going to look at some SQL Query Plans. The easiest way and best way to do this is through SQL Server Management Studio. Go to Query -> Include Actual Execution Plan (or just press Control-M) and the queries you run through SSMS will have the graphical execution plan included as a third tab with your results.

If you can’t run your query through SSMS you can also check for cached plans with the query:

image

With query above you can get all the cached, estimated execution plans on your server, just click the execution plan link and it will open the graphical plan up for you.

A real quick hint, when you are looking at a query plan and see “Clustered Index Scan” or “Table Scan” you may want to look at tuning your query!