DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: Composite Index

  1. #1
    Join Date
    Sep 2000
    Posts
    155
    I have the a table with colA and colB and composite Primary Key. Based on the data below, which pattern would be efficient in terms of performance. Should the PK be
    (colA, colB) OR (colB, colA) ???


    Pattern A
    ========

    colA colB
    1 101
    1 102
    2 101
    2 102
    3 101
    3 102


    Pattern B
    ========

    colB colA
    101 1
    101 2
    102 1
    102 2
    103 1
    103 2



    [Edited by rpardip on 01-25-2001 at 05:51 PM]

  2. #2
    Join Date
    May 2000
    Location
    ATLANTA, GA, USA
    Posts
    3,135
    Where is your query?

  3. #3
    Join Date
    Sep 2000
    Posts
    155
    Query will have both the columns in the WHERE clause with AND operator.

  4. #4
    Join Date
    Aug 2000
    Posts
    194
    In that case, I don't think the order matters.

    But with the "index compression", depends on the cardinality of the column, it may take less or more space, if the order is changed (not sure how much impact, it has on the performance)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width