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 8168369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:30:06+00:00 2026-06-06T20:30:06+00:00

In the article Choosing Index Keys at SQLServerpedia I found the following lines: Since

  • 0

In the article Choosing Index Keys at SQLServerpedia I found the following lines:

Since data in a table is ordered according to the structure of the clustered index, the index built on last_name, first_name won’t behave the same way as the one built on first_name, last_name. The most selective columns should be specified first.

Why? Why should the index on a,b different from that on b,a? Uniqueness of the combination remains same either way, so why should one specify the one which occurs less first?

  • 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-06T20:30:07+00:00Added an answer on June 6, 2026 at 8:30 pm

    Uniqueness is the same but the article mentions behavior. Think about a phone book. If you’re looking for John Smith it’s much easier to find last name = Smith first, then narrow down to first name = John. Try to do it the other way… find all the Johns, then figure out which ones are Smiths?

    So, if you are typically searching for people by last name, it would make sense to order the index by last name then first name. This way all the last names that are the same will be on the same set of index pages.

    This applies obviously to both unique indexes and non-unique indexes. The uniqueness for index key columns is enforced no matter what the order is. Also keep in mind you don’t always need all of the columns to be part of the key – sometimes it is beneficial to just have them as included columns.

    I also don’t think your index should be unique in this specific case, since it’s unlikely that you’re going to have the ability to prevent two John Smiths from signing up for your newsletter, or working at your company, or joining your fight club – last/first is not a good key.

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

Sidebar

Related Questions

The article states the following: http://msdn.microsoft.com/en-us/library/dd799517.aspx Variance does not apply to delegate combination. That
wikipedia article on C states that Function and data pointers permit ad hoc run-time
This article on memory leaks emphasizes that having superfluous event listeners leads to memory
This article explains how to correct an exception that's often seen when switching an
This article from Microsoft details how to implement transport security with an anonymous client
This article on MSDN states that you can use as many try catch blocks
this article suggests you can use Color c = Color.decode(FF0096); however this understandably throws
The article in Wikipedia seems too verbose. I understand framework as a well designed
This article says: Every prime number can be expressed as 30k±1 , 30k±7 ,
one Article has many Comments, and i want to fetch all Articles that have

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.