A year back I have shared a script from query bank, which can be helpful to get indexes list of a database, with key and involved columns. Being a DBA, I never remember a day, without using this script.
Getting detail of indexes on a database most of the time I also need indexes usage statistics, through which I can figure out which indexes are being used and which indexes can be discarded.
To avoid to use two separate scripts, let me share following script which brings both, usage and structural information for all indexes of a database or a given table.
where is the script?
ReplyDeleteyou can directly get it from https://gist.github.com/lionofdezert/3722342#file-alldbindexeslistwithincludecolumns-sql
DeleteHi, Thanks for posting index usages script, I have doubt if User Seek column have high number - 95123 and User scan = 0, so i can deceide this NC index havey usage.. Pls. confirm.
ReplyDeleteHigh number of seeks and less or zero scan means, index is well defined and is being used for query execution.
Delete