Voici un petit snippet pour vous permettre de voir quelles sont les statistiques qui sont attachées aux colonnes des tables :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ------------------------------- -- Nicolas SOUQUET - 16/09/2009 ------------------------------- SELECT T.name AS nomTable, S.name AS nomStatistique, C.name AS nomColonne, S.auto_created AS estCreeeAuto, S.user_created AS estMAJAuto, S.filter_definition AS filtre FROM sys.stats AS S JOIN sys.stats_columns AS SC ON S.object_id = SC.object_id AND S.stats_id = SC.stats_id JOIN sys.columns AS C ON C.object_id = SC.object_id AND C.column_id = SC.column_id JOIN sys.tables AS T ON C.object_id = T.object_id AND T.name NOT LIKE 'sys%' AND T.name NOT LIKE 'dt%' ORDER BY T.name, S.name, C.name |
ElSuket