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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:18:12+00:00 2026-05-31T05:18:12+00:00

I have a table with more than 40k rows and a primary key consisting

  • 0

I have a table with more than 40k rows and a primary key consisting of 2 columns on this table.

Could a seperate nonclustered (NOT unique!) index on ONE of these primary key columns speed up queries on THIS column (without using the other PK columns)? Or would SQL Server use the primary key in an equally efficient manner for accessing only one column of the primary key?

I know a primary key is a unique index but that has nothing to do with the question, I’m just concerned about the primary key spanning multiple columns as opposed to one when accessing data just from one of the PK columns..

  • 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-05-31T05:18:13+00:00Added an answer on May 31, 2026 at 5:18 am

    Supposing the PK is on: Field1, Field2 (in that order)

    • Queries that filter on Field1, can benefit from that PK index (index seek).
    • Queries that filter on Field1 and Field2, can benefit from that PK index (index seek).
    • Queries that filter on Field2, cannot benefit from that PK index (index scan).

    So in the final case, you may consider a separate index on Field2. Note there is a bit more to it if e.g. you are returning other fields in the table other than the PK fields. In this case, if your PK is CLUSTERED (by default, PKs are) then the data is already in the index. But in a NONCLUSTERED index (e.g. if you created one on Field2), it would have to then go off and perform a lookup to get the other fields being returned for the query. So then you can get into the realms of deciding whether to INCLUDE columns in the NONCLUSTERED index or not.

    Recommend doing a bit of reading up on this, it’s worth getting up to speed.

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

Sidebar

Related Questions

I have a table with more than 9 rows. If I do this :
I have a table with more than 10 000 000 rows. In TOAD this
I have a table with more than a millon rows. This table is used
I have a table with more than 100 columns. I need to join it
I have a table with more than 5 columns , i want to hide
I have a MyISAM table with more than 10^7 rows. When adding data to
I have a table with a lot of records (could be more than 500
I have a Postgres table with more than 8 million rows. Given the following
I have a mysql table with more than 17000 rows in it. And I
I have a table in sq server db having more than 1 million rows.

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.