IndexOptimize.sql reorganize indexes #903
Replies: 2 comments
-
This is a bug. I introduced it in the 9 Feb 2025 version, when I was doing some small refactoring to fix some other issues. Thank you for catching it. I have fixed it now. |
Beta Was this translation helpful? Give feedback.
0 replies
-
👍
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I use the IndexOptimize.sql tool, Committed on Feb 16, 2025
I notice that tool is not reorganizing my indexes, only the rebuild is accepted as action for the indexes.
I use this statement:
When checking the IndexOptimize.sql code I find that this code selects the accepted action on an index:
This snipped exclude indexes from reorganization when they allow page locks (NOT @CurrentAllowPageLocks = 1).
Why? This is in contradiction to your previous answer #439
ALTER INDEX ... REORGANIZE is not supported in the following scenarios:
See also this blog which explains why indexes can’t be reorganized when the page level locks are disabled: : https://www.mssqltips.com/sqlservertip/4247/resolve-sql-server-database-index-reorganization-page-level-locking-problem/
Beta Was this translation helpful? Give feedback.
All reactions