tigertoolbox icon indicating copy to clipboard operation
tigertoolbox copied to clipboard

Index-Information - KeyCols_data_length_bytes also aggregates for included columns

Open BobbyH49 opened this issue 2 years ago • 1 comments

Line 678 in view_IndexInformation.sql and line 698 for view_IndexInformation_CurrentDB.sql are aggregating for Key and included columns. Adding "and sic.is_included_column = 0" into the WHERE clause for the "KeyCols_data_length_bytes" column will stop the aggregation from picking up included columns.

BobbyH49 avatar Dec 18 '22 12:12 BobbyH49

Also, why does KeyCols_data_length_bytes have a case statement checking for nvarchar and then dividing by 2? The key length value is in bytes not characters. The case statement can be removed.

BobbyH49 avatar Dec 18 '22 12:12 BobbyH49