microsoft / tigertoolbox

Toolbox repository for Tiger team
http://aka.ms/sqlserverteam
Other
1.48k stars 740 forks source link

Azure columnstore indexes Online mode Fixes #224

Open earthcoder opened 3 years ago

earthcoder commented 3 years ago

Seems the script does not support Columnstore index and azure, and just tries to rebuild and reorg when its not needed too

I edited the script and change following and now seems to work ok IF (SELECT SERVERPROPERTY('EditionID')) IN (1804890536, 1872460670, 610778273, -2117995310,1674378470)
added Azure edition to editioncheck so = 1

IF @sqlmajorver > 11 AND @onlineRebuild = 1 AND @editionCheck = 1 AND @ixtype IN (1,2,5,6) AND @containsLOB = 0 added 5,6 to ixtype

commented out from as was doing reorganize and don't think it's required.. Filtered indexes or indexes that do not allow page locks should always rebuild. */ IF (@fragmentation < @rebuildThreshold AND @ixtype IN (1,2) AND @has_filter = 0 AND @allowPageLocks = 1) --OR (@fragmentation < @rebuildThreshold_cs AND @ixtype IN (5,6))

now i get the following: ALTER INDEX [CSS_xxx] ON [xxxx].[dbo].[xxx] REBUILD PARTITION = 59 WITH (ONLINE = ON (WAIT_AT_LOW_PRIORITY (MAX_DURATION = 1, ABORT_AFTER_WAIT = SELF)));

which is supported on Azure That's all i changed so far and seems to work ok.. please let me know if i shouldn't do this :P