[DOCS-8863] Comment on: "manual/reference/operator/aggregation/limit.txt" Created: 26/Sep/16  Updated: 03/Nov/17  Resolved: 26/Sep/16

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Dan Salmo Assignee: Unassigned
Resolution: Done Votes: 0
Labels: collector-298ba4e7
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Location: https://docs.mongodb.com/manual/reference/operator/aggregation/limit/
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36
Referrer: https://www.google.com/
Screen Resolution: 1440 x 900


Participants:
Days since reply: 7 years, 20 weeks, 2 days ago

 Description   

We seem to have encountered a performance problem with $limit in aggregate queries.

The query is very very slow (half a minute) - when the number of docs passed into the limit step are less than the limit size.

For example, first stage is a $match that only finds 6 docs. Second stage is a sort on an indexed field. Third is a $limit=10.

The query is instantaneous when there are lots of docs returned from stage 1. However, when there are only a few, the aggregate query is very very slow.

Expected behavior: aggregate performance of $limit should be equivalent to a standard query's use of limit.



 Comments   
Comment by Allison Reinheimer Moore [ 26/Sep/16 ]

dan@prattle.co Thanks for your ticket! This jira project (the Docs one) is specifically for issues related to the MongoDB documentation… your issue sounds like it might be a bug in the server, since, as you say, that's not the behavior one might expect.

I would suggest filing a ticket in the Core Server project (https://jira.mongodb.org/secure/CreateIssue!default.jspa?pid=10000) so that our engineers can investigate. Thanks!

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