8 Weeks of Indexes: Determining what you have now.
This is post #5 of my 8 Weeks of Indexes; these are not posted weekly; but I am getting faster at posting them. (Side note: I am making it a personal effort to use time at work [hey it’s learning right] to write my blogs)
When you are given access to a database and are told to manage it; what is the best way to figure out what indexes are available, are they being used, and how big are they?
Let us figure this out step by step.
What Indexes do I have?
Any time I have to determine what indexes a database has, I always use the following script. It is quick, easy and returns most of the information you need to identify an index and it’s configuration.
The below picture is a sample of the results for the above query.
Next, I usually want to know IF the indexes are actually being used. Believe it or not; there are sometimes indexes placed on databases that never get used. And that is just a waste of I/O and disk space.
This query provides the information you need to determine how often the indexes are used and if the SQL Engine is using SEEK, SCAN or LOOKUP to find data (this will be discussed in my next article). If the index is not listed with these results; it has not been used since last index rebuild or SQL Engine restart.
And that is how I determine what indexes a server has, how they are being used and how big they are.
Next week (hopefully), I will go into how to determine if the indexes are effective!