What tools or queries can you use to monitor the health and effectiveness of a columnstore index over time?
Short answer
You can query dynamic management views such as sys.dm_db_column_store_row_group_physical_stats, which shows details about each rowgroup including how many rows it contains and whether it has been fully compressed, helping you decide when a reorganize or rebuild operation would…
Advertisement
AModel answer
You can query dynamic management views such as sys.dm_db_column_store_row_group_physical_stats, which shows details about each rowgroup including how many rows it contains and whether it has been fully compressed, helping you decide when a reorganize or rebuild operation would actually improve performance.
SELECT object_name(object_id) AS TableName, row_group_id, state_desc, total_rows, deleted_rows
FROM sys.dm_db_column_store_row_group_physical_stats
WHERE object_id = OBJECT_ID('SalesFact');Real-world example
A database administrator regularly checks columnstore rowgroup statistics to identify when a large table's index has accumulated too many small, uncompressed rowgroups, scheduling a maintenance window to reorganize it before performance noticeably degrades.
Likely follow-ups
- What does a high number of deleted rows in a rowgroup indicate?
- How often should this monitoring query be run in a production environment?
Related topics