• m.bouffard (8/25/2010)


    Hmm...

    "A clustered index determines the physical order of data in a table. A clustered index is analogous to a telephone directory, which arranges data by last name. Because the clustered index dictates the physical storage order of the data in the table, a table can contain only one clustered index. ."

    "A clustered index is particularly efficient on columns that are often searched for ranges of values. After the row with the first value is found using the clustered index, rows with subsequent indexed values are guaranteed to be physically adjacent."

    http://msdn.microsoft.com/en-us/library/aa933131(SQL.80).aspx

    The first quote is correct. The clustered index does "dictate" the physical storage order. That does not imply that the ordering of the physical storage matches that of the index. Data pages can be scatered through the file; traversing the index in order is done by following the "next page"/"previous page" pointers in the data pages.

    The second quote is incorrect. Rosw with subsequent indexed values are guaranteed to be on the same page or on the next page when following the the pointer chain. They might be physically adjacent, but there is no guarantee at all.

    Here is how the current version of Books Online describes clustered indexes: http://msdn.microsoft.com/en-us/library/ms177443.aspx


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/