tigertoolbox
tigertoolbox copied to clipboard
[AdaptiveIndexDefrag] null @DataCompression parameter leads to null @rebuildCommand
If @DataCompression is null, according to spec, it should preserve existing compression for an index. Instead when a rebuild or regenerate is needed, the @rebuildCommand evaluate to null after lines 1613-1630 because @currCompression is always null.
I could not find a place where the column 'compression_type' in table 'tbl_AdaptiveIndexDefrag_Working' gets populated with existing values, so rows in that table default to null for 'compression_type' and when the code retrieve the single record to build the @rebuildCommand and executes
@rebuildcommand = @rebuildcommand + N'DATA_COMPRESSION = ' + @currCompression '
@rebuildcommand becomes NULL and subsequently no ALTER INDEX gets executed.
All the relate debug messages are also lost for the same reason: varchar + NULL = NULL
HI, should be fixed with #94 just checked-in for v1.6.6.6. Can you please verify?
At line 1635 should be IF @dataCompression IS NULL AND @ixtype IN (1,2) and @currCompression is not null