• Jeff Moden (2/15/2011)


    Gail and Grant (or anyone else that can jump in),

    The article also has the following statements:

    ...[font="Arial Black"]whereas, with a nonclustered index the leaf level contains the address to the data pages contained in the search.[/font] Simply put, a clustered index is stored and sorted with the data in the clustered index key order. [font="Arial Black"]While the nonclustered index may be thought of as a pointer to the location of the data to which it refers.[/font]

    I believe, from what you've shown me with DBCC IND, that the bolded statements in the above quote from the article are just not correct. To wit, if they were correct, even a covering index would cause "BookMark Lookups". Since I'm not an expert on indexes that you good folks are, can you confirm that the bolded statements in the above quote are, depending on whether it's a covering index or not, incorrect... or not? I realize that data is stored in the index but that data is actually used if it's a covering index.

    Or... perhaps I'm just being a bit too critical of an introductory article.

    {edit} And, yes, I realize that either the clustered index or an internal row number (for heaps) is used in an index which may be thought of as an "address" of sorts but the statements in the quote make it sound as if only address information is stored or that the lookup data stored cannot be used directly.

    Thanks.

    I think what he means there is that the rest of the data, that which is not a part of the nonclustered key or added by the INCLUDE statement, is stored at the clustered index and a pointer back to the cluster is stored at the leaf of the nonclustered index. I'm pretty sure that's what he meant, but the way it's written, I think it is subject to the interpretation you're giving it. He's basically right on this one, but it's phrased a bit awkwardly. At least that's my opinion on it.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning