Cluster index on two fields

  • Hi everyone,

    I have a table with approximately 50 columns, I want to create a clustered index on two columns. One column is the first column in the table and the other is the second to the last column. My question is, does it matter, performance wise, would it have been better if they were next to each other? Or it doesn't matter, since SQL Server pulls a page into memory instead of individual columns (I'm not 100% sure about this)?

    Thanks in advance.

  • Doesn't make the slightest difference, the way the columns are specified in the create table is not necessarily the way they are stored on the page, and the order of columns in a table is irrelevant for any SQL operations.

    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
  • Works for me. 🙂

    Thanks!

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

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