Primary Key Sort Order

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TimSki
    New Member
    • Jan 2008
    • 83

    Primary Key Sort Order

    Hi,

    I have a large table (2M rows) with an id column. I've put a primary key on the id column which in turn automatically creates a clustered index on this column in ASC order. All of my queries are actually based on sorting the id in DESC order. Would it be advantageous for me to recreate my primary key with the sort order as DESC ??

    Thanks in advance
  • RedSon
    Recognized Expert Expert
    • Jan 2007
    • 4980

    #2
    I don't think the index cares if it is ASC or DESC. It's a n-time operation either way. I would suggest using the analyser to see if your queries save any time using a DESC key and removing the DESC from your statement.

    Comment

    Working...