• ANn -425914 (2/27/2015)


    I forgot to ask:

    for indexes, does the order of column matters?

    For example I want to create an index of ID, SchoolID, on terms table.

    Does the order of the column matter in the index?

    Thanks,

    Yes, primarily because the historgram of the statistics is only created on the first column. So, generally, but not always, you want the most restrictive column to be first because it will give you the best data distribution within the histogram.

    "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