Composite Index - SQL Server
The sys.dm_db_index_usage_stats DMV gives information about number of seeks and scans against a index in sql server
I have a large number of composite index that includes multiple columns. I suspect that these indexes cause a lot of ma开发者_StackOverflowintenance overhead ann would like to narrow the number of columns.
Is there a way we can find out seeks and scans against a indivudual columns in a composite index.
SQL Server
does not implement SKIP SCAN
, so a seek over a composite index always includes leftmost (leading) columns of the index.
That is, if you have an index on (col1, col2)
, the index seek may be used for searching for col1
or col1
and col2
, but not for col2
alone.
If you search for all of these columns, you will most probably benefit from using the index.
What is the "maintenance overhead" you mentioned and how does it differ between single-column and multiple-column indexes?
精彩评论