Sonntag, September 25, 2011

Index Rebuilds und der Clustering Factor

Nächstes Quiz des Herrn Foote, diesmal zur Frage, wann ein Index Rebuild den Clustering Factor ändern kann. Im Grunde ist die Antwort: nie, aber es gibt doch ein paar Spezialfälle, die man als Ausnahmen von der Regel betrachten kann. Grundsätzlich gilt:
So for an index rebuild to actual have an impact on the CF on an index, means either the rows in the table needs to change or the order of the index entries needs to change.
However, when we typically rebuild an index, it has no impact at all on the table and so can’t possibly change the order of the rows there. Additionally, no matter how fragmented or inefficient the index structure might be, an index rebuild doesn’t change the order of the index entries either as they’re always sorted within the index in the order of the indexed columns.
Die Ausnahmen der  Regel sind Indizes, die von REVERSE auf NOREVERSE oder umgekehrt umgestellt werden - was aus meiner Sicht aber eigentlich etwas Anderes ist als ein einfacher Neuaufbau. Ein anderer Spezialfall wäre die Definitionsänderung eines FBI - aber auch das ist kein einfaches Rebuild. Damit kann man für alle praktischen Fälle wohl doch bei der Regel bleiben, dass nur ein Neuaufbau der Tabelle den Clustering Factor eines Index ändern kann.

Keine Kommentare:

Kommentar veröffentlichen