Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Index-Information - KeyCols_data_length_bytes also aggregates for included columns #291

Open
BobbyH49 opened this issue Dec 18, 2022 · 1 comment

Comments

@BobbyH49
Copy link

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant