• GilaMonster (3/5/2014)


    ChrisM@Work (3/5/2014)


    - The size stats of the two ordinary indexes is virtually the same.

    Exactly.

    A column cannot be present in an index twice.

    Yes I know but...

    If a column is explicitly specified as part of the index and it is part of the clustered index key, it will be present in the index once.

    ...I didn't know this.

    If it's specified as a key column, it will be a key column. If it's specified as an include column then, if the index is non-unique, it will be a key column (which it would have been anyway if it was just implicitly part of the index), otherwise it will be an include column.

    Thank you Gail. That's an interesting and useful lesson.

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden