Index Statistics

As mentioned earlier, the selectivity of a key is an important factor that determines whether an index will be used for a query. SQL Server stores the selectivity and the histogram of sample values of the key in the statblob column on the sysindexes system table. Based on the values stored in this column for the index, and the SARGs specified for the query, the query optimizer decides which index to use.

The statblob column is an image column. To see the statistical information stored in the statblob column, use the DBCC SHOW_STATISTICS command, which returns the following pieces of information:

  • A histogram containing an even sampling of the values for the first column in the index key. SQL Server stores up to 200 sample values ...

Get Microsoft® SQL Server™ 2000 Unleashed, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.