SQL Server Performance

column order in an index

Discussion in 'Performance Tuning for DBAs' started by Rocky, Oct 17, 2006.

  1. Rocky New Member

    Hi,

    I am looking at a database which has one of the columns present in almost all tables and that column is also part of the PKs and hence is part of the indexes as well.

    example:
    emp_table dept_table
    --------- ----------
    cntry_id cntry_id
    emp_id dept_id
    name dept_name
    | |
    | |

    Clearly cntry_id & emp_id will be the combination PK for emp_table and similar will be the case for dept_table. So the index on these tables are having columns in this order : cntry_id, emp_id and so on.

    But the current implementation allows only one value for cntry_id, that is, cntry_id is same for all the records in the table. But still it has to be part of the combination PK.

    Now my question is, since value for cntry_id is same for all the records, will changing the order of the index improve performance (index in the order: emp_id,cntry_id).

    Best regards,
  2. Adriaan New Member

    Please do not double post ...
  3. FrankKalis Moderator

    As Adriaan indicated, please post your question only once.

    --
    Frank Kalis
    Moderator
    Microsoft SQL Server MVP
    Webmaster:http://www.insidesql.de

Share This Page