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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:27:26+00:00 2026-06-15T11:27:26+00:00

I have a covering index that encompasses field a b and c , in

  • 0

I have a covering index that encompasses field a b and c, in that sequence.

ALTER TABLE table ADD INDEX covering(a, b, c)

The following query uses the covering index, more specifically just the first field in the covering index.

SELECT * FROM table
GROUP BY a

Would I observe a performance increase if I created another index that exclusively encompassed a?

ALTER TABLE table ADD INDEX a(a)

Or does the above index work exactly the same way as the covering index on the SELECT statement?

What if my query was GROUP‘ing on a a field that was not the first in sequence in the covering index?

SELECT * FROM table
GROUP BY b

And my index was

ALTER TABLE table ADD INDEX b(b)
  • 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-15T11:27:27+00:00Added an answer on June 15, 2026 at 11:27 am

    If you have compound index on (a, b, c) and use ORDER BY a, then it will work and make use of that index. Adding index on just (a) will make it more preferable to query planner, but it will be wasteful as you have to keep more data in indexes, and also to update both indexes when table gets updated. There will be small gain from using narrower index, but it could be difficult to quantify that advantage.

    As for querying using ORDER BY b, it could not use any of the indexes above, and you must create index on (b) or compound index on (b, ...) to get reasonable performance.

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

Sidebar

Related Questions

I have a MySQL table with an index covering two fields. If I insert
I have the following query which shows the distinct ip addresses that made requests
I have a single image covering the entire background. Do sites that do this
I’m working on optimizing some of my queries and I have a query that
I have a git repository (covering more or less project history) and separate sources
I have the following query EXPLAIN SELECT COUNT(DISTINCT ip_address) as ip_address, exec_date FROM requests
I have a table with two indexes, one of which is the faster covering
Assuming that a table contains sufficient information to warrant an index seek, at what
I have a modal view that slides up covering the visible view. Based on
I have a UIView that is not covering the entire screen of an iPhone...

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.