Creating indexes with same key column but different include

  • Feasible, but probably not a good idea.

    Unless the query which uses the smaller one is so time-sensitive that it cannot possibly take a millisecond longer, you're probably best off merging those two into one index.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • I'd defer to Gail here, and I agree. Merge the indexes. AFAIK, the order of columns in the include doesn't matter.

  • Steve Jones - SSC Editor (7/1/2015)


    AFAIK, the order of columns in the include doesn't matter.

    Correct.

    Order of columns matters in the key, not in the include

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 3 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply