r/SQLServer • u/erinstellato Microsoft Employee • Jul 24 '26
Community Request Friday Feedback: Automatic Index Compaction
Friday feedback this week is about a feature that’s in preview in Azure SQL: automatic index compaction.
You can read more about it in Dimitri‘s blog post, Stop defragmenting and start living: introducing auto index compaction: https://techcommunity.microsoft.com/blog/azuresqlblog/stop-defragmenting-and-start-living-introducing-auto-index-compaction/4500089
(sidenote: one of the best blog titles in recent memory)
Quick poll below, and feel free to add a comment if the poll doesn’t cover your thoughts/experience!
6
u/ITWorkAccountOnly Jul 24 '26
Will this feature be brought to on-premise SQL versions or is this going to remain a cloud-only DB feature?
As a DBA with mostly on-prem servers, this seems very useful and I'd love to try it if that's an option.
1
u/ovenmitt545 Jul 24 '26
We tested this on a dev server and love it but won't deploy it further until it comes out of GA.
If I could make a recommendation, add enabling this to the Azure Portal. If a feature is a boolean response it should be available there to speed up deployment and/or make it a default value when deploying new databases without having to script out the change.
1
u/chandleya Jul 24 '26
The gap between the two no’s is weird. I’m neither waiting for GA or abstaining from Azure SQL.
1
u/B1zmark 1 Jul 24 '26
2 of the biggest issues that index rebuilds resolve are: Page density and statistics. These are 2 of the biggest issues that tend to be fixed by/caused by poor index management.
Compaction feels like its doing a partial reorganise in a manner than benefits MS as a cloud provider: Higher density meaning less RAM usage, and a "delta" compaction, meaning its not running through the whole index, saving on hard-disk hits.
I think from a customer perspective, an automated process to find "quiet" windows and detect when statistics are stale, then doing an online rebuild would solve all these issues an more.
As it stands, compaction is better than nothing sometimes, and significantly worse other times - the example given in the link being a really, really "bad for the customer" example, because mass page splits are almost guaranteed on the next run of the offending operation.
I hope i'm wrong and this is a good thing overall, because indexes are something of a hot topic in the DBA sphere and something i don't think MS have made big strides to help customers with on the best practice front since the 5%/30% debacle.
1
u/SonOfZork Jul 25 '26
I hate to think of the cost of running this on Hyperscale given the backups charge for every page written.