One of the most popular questions which I received during my Comprehensive Database Performance Health Check is how to identify which index is used for any query. While this looks like a very simple question, it is actually not that simple. Let us see in today’s SQL in Sixty Seconds video how one can identify the index used for the query.
Identify Index Used for Query
In the video, I have used sample database WideWorldImporters. You can read more about that over How to Import New Sample Database WideWorldImporters.
As we have learned in the video, you can get the information about the index from hovering over the operator which is retrieving the data from the table. Here you can see if the table is using the index or doing the heap scan. There is also much other important information also available in the popup image. I will be blogging about them in the future.
If you do not want to use this method, you can also just go to the table operator and check the property of the same. Once you open the property, you can go learn more about it as well. The property of the table can be also opened by keyboard shortcut F4.
Well, that’s it for today. Please leave a note in the comment section about the feedback of the video. I have previously created many videos that you can find if you are subscribed to my youtube channel.
Here are my recent five SQL in the Sixty Seconds video:
- Stress Testing with oStress – SQL in Sixty Seconds #087
- How to Get Started with SQL Server 2016? – Interview Question of the Week #086
- Impact of DBCC DROPCLEANBUFFERS on Memory – SQL in Sixty Seconds #085
- Impact of CHECKPOINT On Memory – SQL in Sixty Seconds #084
- Get Column Names From a Specific Table – SQL in Sixty Seconds #083
Reference: Pinal Dave (https://blog.sqlauthority.com)