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

  • Home
  • SEARCH
  • 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 8576967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:03:17+00:00 2026-06-11T20:03:17+00:00

After Using the Display Estimated Execution Plan on two queries, I ended up creating

  • 0

After Using the “Display Estimated Execution Plan” on two queries, I ended up creating two indexes as follows:

CREATE NONCLUSTERED INDEX IX_ABC ON dbo.my_table
(colA,colB,colC)

and

CREATE NONCLUSTERED INDEX IX_ABC ON dbo.my_table
(colA,colD,colE)

I noticed that creating just one index (replacing the above two):

CREATE NONCLUSTERED INDEX IX_ABC ON dbo.my_table
(colA,colB,colC,colD,colE)

also optimizes my queries.

So my question is, is it correct that the index with all the columns optimizes as well as two separate ones or is one method preferable to the other.

Thanks

  • 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-11T20:03:19+00:00Added an answer on June 11, 2026 at 8:03 pm

    To answer your question simply, order is important (think of a multi-level tree) so a combined index will not help with a query that only searches ColA, ColD, and ColE and not ColB and ColC.

    So, for example, if you had a query like
    SELECT colA, colD, colE
    FROM dbo.my_table
    WHERE colA = 1 AND colD = 2

    the second (combined) index would help somewhat (with the ‘ColA’ predicate) but the database would still have to scan the remaining results for colD = 2.

    On the other hand, the combined index will take up less overall space, and have less of an impact on updates to column A, so you will have to weigh the tradeoffs.

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

Sidebar

Related Questions

I'm having trouble to display data after form submition using JS and AJAX here
After using hg qnew and hg qrefresh to create and update a patch that
how to display a message dialogue box after registration using struts2? just as in
I'm trying to get what's inside a <div> with ID of display using $(#display).after(html);
After using several non compatible barcode generators gems in rails 3.2, i am trying
After using grep command, i will give you a small example grep test test
After using a few validation libraries I finally decided to roll my own implementation,
After using the ebay API recently, I was expecting it to be as simple
After using PHP for a while now, I've noticed that not all built-in PHP
after using own custom cms for over 6 years, I decided to go for

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.