yochananrachamim / AzureSQL

129 stars 61 forks source link

AzureSQLMaintenance.txt - When using All and smart option no need to skip stats update for indexes that go for reorganize #25

Closed yochananrachamim closed 1 year ago

yochananrachamim commented 2 years ago

as per comment from Ian on the blog post

https://techcommunity.microsoft.com/t5/azure-database-support-blog/how-to-maintain-azure-sql-indexes-and-statistics/bc-p/3029677#M583

ianstirk Occasional Visitor ‎Jan 07 2022 11:33 AM Hi, thanks for creating this utility, it's very useful. Looking at the code, I can see it says "Remove statistics if it is handled by index rebuild / reorginize...", please note that an index reorg does not update the statistics e.g. https://dba.stackexchange.com/questions/48991/does-a-re-index-update-statistics thanks Ian

this is confirmed, and we should not skip updating stats when their corresponding index goes for reorganize

yochananrachamim commented 1 year ago

Fixed, we now skip only for rebuild. Thank you lan for sharing your feedback.