Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9023421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:45:26+00:00 2026-06-16T05:45:26+00:00

Possible Duplicate: SQL Server Clustered Index – Order of Index Question I understand that

  • 0

Possible Duplicate:
SQL Server Clustered Index – Order of Index Question

I understand that column order in a clustered index is important.

I plan to add a clustered index on 3 columns that are always involved in where clauses -an int, bit and datetimeoffset columns. In addition, the datetimeoffset column stores incremental values.

Would it make sense to have the datetimeoffset column as the first one in the clustered index? Appreciate it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T05:45:27+00:00Added an answer on June 16, 2026 at 5:45 am

    As Michael mentioned, the column order in your index is directly linked to what you have in your WHERE clause.

    To illustrate this point, as a test I created three tables, each with a different column as the first in the clustered index. Then, I populated them with 10,000 rows of data.

    Executing the same SQL query across all three tables yields very different performance results:

    set statistics io on
    set statistics time on
    
    select * from DtFirst where DtCol between '4/1/2010' and '6/1/2010'
    select * from IntFirst where DtCol between '4/1/2010' and '6/1/2010'
    select * from BitFirst where DtCol between '4/1/2010' and '6/1/2010'
    
    set statistics io off
    set statistics time off
    

    Statistics are as follows:

    First table (Date Column first)
    Scan count 1, logical reads 3
    CPU time = 0 ms, elapsed time = 0 ms.

    Second table (Date Column second)
    Scan count 1, logical reads 29
    CPU time = 0 ms, elapsed time = 113 ms.

    Third table (Date Column third)
    Scan count 1, logical reads 29
    CPU time = 0 ms, elapsed time = 145 ms.

    As you can see, querying on the date on the table where the date column is ordered first in the clustered index clearly produces much better results.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: SQL Server: Can I Comma Delimit Multiple Rows Into One Column? I
Possible Duplicate: SQL Server Database query help Hi, I have a problem that I
Possible Duplicate: SQL Server how to drop identity from a column How I alter
Possible Duplicate: Splitting one column into two columns in SQL Server CE I am
Possible Duplicate: Is there a Max function in SQL Server that takes two values
Possible Duplicate: trim left characters in sql server? I have a query below that
Possible Duplicate: SQL Server: Can I Comma Delimit Multiple Rows Into One Column? SQL
Possible Duplicate: SQL Server 2008 : Cannot Insert new column in the middle position
Possible Duplicate: SQL Server: Can I Comma Delimit Multiple Rows Into One Column? Script
Possible Duplicate: SQL Server: How do you return the column names from a table?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.