Software Development Redmond, Washington
Azure SQL Automatic Index Compaction improves index page density by consolidating eligible pages in the background, potentially reducing the number of pages queries must read. It matters to database administrators and teams managing write-intensive Azure SQL workloads with frequent inserts, updates, or deletes. Microsoft demonstrates the compaction effect in an Azure SQL Hyperscale example.
When rows are deleted or updated, index pages can become sparsely populated even if fragmentation percentage alone does not flag the main problem. Low page density means an operation may need to read more pages than a compact index would require. Compaction targets page utilization, rather than rebuilding an entire index.
The engine works asynchronously through background processing associated with the Persistent Version Store cleaner. It can move rows from a neighboring page into available space, while respecting the index fill factor, and deallocate pages that become empty. In Microsoft's demo, page density rose from 47.1% after scattered deletes to 95.0% after compaction; the page count fell from 18,004 to 8,909.
This is relevant to database teams responsible for Azure SQL Database and Azure SQL Managed Instance workloads where ongoing data changes leave indexes with underused pages. Automatic Index Compaction is generally available for Azure SQL Database, Azure SQL Managed Instance with the Always-up-to-date update policy, and SQL database in Microsoft Fabric.
The starting point is the database that contains the affected indexes. Evaluate the setting against a representative workload and compare index page density, logical reads, and query performance before relying on it to change maintenance routines.
Unlike scheduled maintenance that evaluates and reorganizes or rebuilds indexes as a whole, automatic compaction works incrementally on eligible pages affected by data changes. It is intended to reduce sparse-page overhead without requiring an administrator to initiate a full index operation.
Compaction is not a substitute for every index-maintenance task. It does not update statistics, so statistics maintenance remains separate. It focuses on eligible, recently modified pages rather than scanning and optimizing every page in every index.
Microsoft also notes that compaction can increase transaction-log write I/O and transaction-log backup size in write-intensive workloads. Keep existing maintenance decisions tied to the workload's needs, and monitor those costs alongside read performance. The demo's measurements describe one workload, not a guaranteed result for every database.
It consolidates eligible index pages in the background, moving rows into available space and deallocating pages that become empty. This can improve page density and reduce pages read.
No. Statistics maintenance remains a separate task.
It is generally available in Azure SQL Database, Azure SQL Managed Instance with the Always-up-to-date update policy, and SQL database in Microsoft Fabric.
It can increase transaction-log write I/O and transaction-log backup size, particularly in write-intensive workloads.