Unexpected stats_column_id behavior - by swasheck

Status : 

 


20
0
Sign in
to vote
ID 1163126 Comments
Status Active Workarounds
Type Bug Repros 5
Opened 3/5/2015 2:07:41 PM
Access Restriction Public

Description

MSDN notes that sys.stats_columns.stats_column_id is "1-based ordinal within set of stats columns." However, it seems to actually reflect table definition order. Altering index order is not reflected in sys.stats_columns. 

Additional evidence:
http://dba.stackexchange.com/questions/91118/stats-column-id-and-index-column-id-do-not-update-with-physical-order-of-cluster

http://dba.stackexchange.com/questions/94533/is-sys-stats-columns-incorrect

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/a02e2f4c-de74-4112-932b-9cc4b080c014/incorrect-statistics-column-order-on-a-composite-clustered-pk?forum=transactsql

Note: This behavior has been observed on all versions 2008-2014
Sign in to post a comment.