sp_Blitz Result: Partitioned Tables with Non-Aligned Indexes

Table partitioning is a complex way to break out your large tables into smaller, more manageable chunks, but it comes with a lot of management heartache.  One of the challenges is making sure that your indexes are partitioned and aligned the same way as your clustered index.  We’ve written a lot about the pros and cons of table partitioning.

This part of our SQL Server sp_Blitz script checks the DMVs sys.objects, sys.indexes, and sys.data_spaces to see if they line up and have the same number of partitions.  It only checks at the database level – to see the individual objects having the problem, run this diagnostic query – and thanks to Alin Selicean for improving this query!

To Fix the Problem

Depending on the size of the data involved, this could be a pretty big problem that involves taking a maintenance window.  Time to hit the books – start reading our partitioning resources.

Return to sp_Blitz or Ask Us Questions

Menu
{"cart_token":"","hash":"","cart_data":""}