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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:51:20+00:00 2026-05-11T02:51:20+00:00

Is creating an index for a column that is being summed is faster than

  • 0

Is creating an index for a column that is being summed is faster than no 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. 2026-05-11T02:51:21+00:00Added an answer on May 11, 2026 at 2:51 am

    Sorry, it is not clear what you are asking.

    Are you asking, would it speed up a query such as

    SELECT product, sum(quantity) FROM receipts  GROUP BY product 

    if you added an index on quantity?

    If that is the question, then the answer is no. Generally speaking, indexes are helpful when you need to find just a few rows among many; here you need all rows, so an index does not help.

    There is an obscure exception (which applies so rarely most DB optimizers probably don’t bother implementing this trick). If your query happens to be

    SELECT sum(foo) FROM bar 

    , where there is an index on foo, and bar is a table with many columns, it is possible to read in the full index, incurring a smaller hit than if you read the underlying table, and get the answer directly from the index — never having to touch the ‘real’ table at all! This is a fairly rare case, however, and you will want to test that your optimizer knows to do this before relying on this too much.

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

Sidebar

Related Questions

When creating an index over a column that is going to be UNIQUE (but
I need help with creating a C# method that returns the index of the
Obviously (methinks), creating an index on a BIT column is unnecessary. However, if you
When creating indexes for an SQL table,if i had an index on 2 columns
I'm creating a function in C to convert an index value into a string,
I am having an issue with creating a splice for a weighted index. I
Creating liquid layouts is an immense pain. Now, I totally understand that tables should
The idea: I'm creating a div that will change to position:fixed once the top
I have a query that picks out a specific row/column from a large database.
Okay basically I am creating a stored procedure that will return data for our

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.