r/SQLServer • ‪ ‪Microsoft Employee ‪ • Mar 18 '26

Community Share Introducing Automatic Index Compaction

We just released a MSSQL engine feature that might just make the whole index maintenance debate obsolete (or should at least make it less boring). Auto index compaction is now in public preview in Azure SQL and Fabric SQL.

Announcement blog: Stop defragmenting and start living: introducing auto index compaction.

Documentation (with an FAQ): Automatic Index Compaction | Microsoft Learn.

Would you use this instead of your own index maintenance? Tell us what you think.

55 Upvotes

32 comments sorted by

View all comments

Show parent comment

1

u/muaddba 1 Mar 19 '26

I think being able to exclude specific tables would be a configuration item worth adding. An example might be "fill" tables or tables that are completely reloaded frequently, the overhead of the background process analyzing all of that insert activity may slow the loads down. It would be a shame to be unable to use this feature due to a couple of tables in a given database.

2

u/dfurmanms ‪ ‪Microsoft Employee ‪ Mar 19 '26

There is no analysis or other compaction-related activity at insert time or during any other DML. In fact, there isn't any analysis that examines the entire table. Each compaction attempt only looks at a few recently modified pages.

But point taken, it's pointless to do any compaction work for data that is transient and will be deleted or reloaded soon anyway.