r/SQLServer • u/bobwardms Microsoft Employee • Mar 31 '26
Community Share Introducing Automatic Index Compaction
For my entire career index maintenance, specifically index reorganization, has required some manual effort or some scheduled work. We have now introduced in #azuresql an option called Automatic Index Compaction. I'm sure you will have questions. And the very capable u/dfurmanms has them in our documentation at https://learn.microsoft.com/sql/relational-databases/indexes/automatic-index-compaction.
32
Upvotes
21
u/taspeotis Mar 31 '26
Hi Bob, looks like this feature helps a lot but besides that I wanted to say thanks for posting to Reddit. It’s cool to see Microsoft employees on here rather than as avatars on blog posts or LinkedIn.
8
u/XhantiB Mar 31 '26
I really hope this makes it into on prem versions of sql server. Its such a great feature
4
u/Grogg2000 Mar 31 '26
OnPrem, when? 2025CU12 or 2027?
2
u/Think-Trouble623 Mar 31 '26
Bob - loved hearing you speak at SQLCon. I enabled this as soon as I got back to the office Monday and it’s been looking good.
1
u/B1zmark 1 Mar 31 '26 edited Mar 31 '26
I opened the link thinking "OK, is this just a rename of rebuild/reorg?" but if it is something totally new, then it could be interesting.
I look forward to the community getting their hands on it and showing us the pros and cons.
EDIT
I just glazed over something important: This process doesn't do anything to help manage statistics? Doesn't that make stats and therefore plans significantly worse? In larger indexes, statistic sampling is already wholly inadequate - The more i read about this the more it seems functionally equivalent to an online reorganize.
1
u/SirReginaldTheThird Mar 31 '26
Still in preview, any word when it's GA?
0
u/throwaway18000081 Mar 31 '26
I implemented this in a few NonProd workloads last week and then enabled it in a few Prod databases this week. The results have been amazing for me thus far, queries that used to cause issues are now running on optimal execution plans, it has eliminated a lot of parameter sniffing that occurred in my environment due to queries coming from ORM.
Keep stats and index maintenance in place for now as that is recommended (in the documentation) for certain environments, will slowly test the removal of stats jobs.
0
u/[deleted] Mar 31 '26
[deleted] — view deleted comment