SQL SERVER – Find a Table in Execution Plan

One of the most asked questions in Comprehensive Database Performance Health Check, when we are discussing the execution plan, is to if we can find a trail of the table in Execution Plan. Of course yes, we can easily find a table in the execution plan with the Find Node feature of SSMS (SQL Server Management Studio).

SQL SERVER - Find a Table in Execution Plan findatable-800x191

Finding the table in a huge execution plan is always a nightmare and often people go for third party tool for help. I have also seen experts going through the XML execution plan to find the occurrence of the table. While all other methods work fine, let us see how easily we can find this in an SSMS.

Let us assume that this is your query.

SELECT *
FROM [Sales].[Orders] o
INNER JOIN [Sales].[OrderLines] ol ON o.OrderID = ol.OrderID

Now let us enable the execution plan when you run the above query against the sample database WideWorldImporters. Here is the blog post which discusses how to enable an execution plan. Now once you have an execution plan, right-click on it and select the Find Node.

SQL SERVER - Find a Table in Execution Plan findatable1

It will bring up the following dropdown. Over here, select the first drop down as table and second drop-down as contains and the third one is orderlines.

SQL SERVER - Find a Table in Execution Plan findatable2

Once you select the above option, click on the arrows next. This will cycle through all the occurrences of the table. I am very confident that this tip will be very much helpful when the query is complicated and there are plenty of nodes in the SSMS execution plan.

SQL SERVER - Find a Table in Execution Plan findatable3

Do you want me to create a video on this topic, if yes, please let me know in the comments section and I will be happy to build a video on this topic? You can subscribe to my YouTube Channel where I talk about SQL in the Sixty Seconds. I am very confident that you will like the videos.

Reference: Pinal Dave (https://blog.sqlauthority.com)

, , ,
Previous Post
Transactions and Variables – SQL in Sixty Seconds #150
Next Post
SQL SERVER – CHECK CONSTRAINT to Allow Only Digits in Column

Related Posts

1 Comment. Leave new

Leave a Reply

Menu