[SERVER-21502] $group using index Created: 17/Nov/15  Updated: 17/Nov/15  Resolved: 17/Nov/15

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Benjamin Appréderisse Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-4507 aggregation: optimize $group to take... Backlog
Related
related to SERVER-21471 Bad index selection on aggregate with... Closed
Participants:

 Description   

It would be great for a $group stage to use indexes for easy group.

For example, this aggregation

[
{
    $group: {
        _id: "$media",
        count: {$sum:1}
    }
},
{
    $sort: {
        count: 1
    }
},
{
    $limit: 10
}
]

is not using the "media" index.



 Comments   
Comment by Benjamin Appréderisse [ 17/Nov/15 ]

Hi,

Indeed, this looks like a duplicate ticket.
I will follow the other one.

Thanks.

Comment by Charlie Swanson [ 17/Nov/15 ]

Hi bappr,

This is a totally valid request, and something we should absolutely do in the future. We already have SERVER-4507 open which I believe is asking for the same thing, or something that would also solve your use case. If not, please re-open this ticket and describe the differences. If that does sound similar, please follow that ticket to track our progress.

I'll close this as a duplicate, but as I said, feel free to re-open if you think it is not.

Comment by Ramon Fernandez Marina [ 17/Nov/15 ]

This looks like the same issue as SERVER-21471, which is being investigated. What version of MongoDB are you using? Have you tried with the latest release candidate, 3.2.0-rc2?

Generated at Thu Feb 08 03:57:32 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.