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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T13:43:14+00:00 2026-06-02T13:43:14+00:00

select a,b,max(c) from myTable where a>b group by a,b my first instinct is to

  • 0
select a,b,max(c) from myTable
where a>b
group by a,b

my first instinct is to open a clustered index for [a,b,c]

and here is the question :

suppose someone is running another simple select :

select a from myTable.

will the [a] column will be seeked throught the [a,b,c] index? or it wont use index at all…? (my guess it will use the [a,b,c] index)

but i guess it wont be fast as a single [a] index…

so what should i do ?

create [a,b,c] index
or
create [a,b,c] + [a] index

  • 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-02T13:43:16+00:00Added an answer on June 2, 2026 at 1:43 pm

    Your first thought is correct. The query:

    SELECT a
    FROM myTable
    

    will be able to use the (a,b,c) index effectively. No need to add the (a) index.


    As to whether this index should be clustered or not, that’s a whole other discussion. Since SQL-Server allows only one clustered index per table, the choice should be made wisely. See the MSDN articles: Clustered Index Design Guidelines and Creating Clustered Indexes.

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

Sidebar

Related Questions

myTable UNID 9 10 UNID is a VARCHAR2 select max(UNID) from myTable returns the
SELECT MAX(some_field) FROM table_A GROUP BY another_field This only gets the max value of
SELECT MAX(crash_year) AS crash_year, COUNT(crash_year) AS COUNT FROM nyccrash GROUP BY crash_year ORDER BY
I'm doing: select * from mytable y where y.year = (select max(yi.year) from mytable
My query currently is: SELECT x, MAX(z) AS mz, y FROM my_table GROUP BY
select max(Key) from MyTable with(nolock) I have this T-SQL statement but need to use
The scenario is this: select max date from some table, when the target table
When I attempt to do something like SELECT Max(ObjectId) FROM Objects; I see that
When I execute this query: Dim Var Var = ("select max(Autonumber) from tblAutonumber") DoCmd.RunSQL
SELECT MAX(verification_id) FROM VERIFICATION_TABLE WHERE head = 687422 AND mbr = 23102 AND RTRIM(LTRIM(lname))

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.