[DOCS-489] Aggregation Framework: Make Indexing Requirements More Explicit Created: 05/Sep/12 Updated: 30/Oct/23 Resolved: 13/Sep/12 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | manual |
| Affects Version/s: | mongodb-2.2 |
| Fix Version/s: | Server_Docs_20231030 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Adam Comerford | Assignee: | Kay Kim (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: | |
| Days since reply: | 11 years, 22 weeks, 6 days ago |
| Description |
|
This stems from a Dev chat discussion (I will paste relevant pieces in the issue) about the somewhat vague assertions regarding the use of indexes in the aggregation framework. Rather than references to "early stages" etc. it would be best to be more explicit and clearly state when indexes can and cannot be used. |
| Comments |
| Comment by auto [ 13/Sep/12 ] |
|
Author: {u'date': u'2012-09-13T15:13:42-07:00', u'email': u'samk@10gen.com', u'name': u'Sam Kleinman'}Message: merge: |
| Comment by auto [ 13/Sep/12 ] |
|
Author: {u'date': u'2012-09-13T14:34:17-07:00', u'email': u'kay.kim@10gen.com', u'name': u'kay'}Message: |
| Comment by auto [ 13/Sep/12 ] |
|
Author: {u'date': u'2012-09-13T14:41:10-07:00', u'email': u'samk@10gen.com', u'name': u'Sam Kleinman'}Message: minor: |
| Comment by auto [ 13/Sep/12 ] |
|
Author: {u'date': u'2012-09-13T14:31:23-07:00', u'email': u'samk@10gen.com', u'name': u'Sam Kleinman'}Message: merge: |
| Comment by auto [ 13/Sep/12 ] |
|
Author: {u'date': u'2012-09-13T13:23:20-07:00', u'email': u'kay.kim@10gen.com', u'name': u'kay'}Message: |
| Comment by auto [ 13/Sep/12 ] |
|
Author: {u'date': u'2012-09-13T12:57:44-07:00', u'email': u'kay.kim@10gen.com', u'name': u'kay'}Message: |
| Comment by Adam Comerford [ 05/Sep/12 ] |
|
Specific pieces to improve: http://docs.mongodb.org/manual/applications/aggregation/#early-filtering
This should be more explicit. For example: Any early use of the $project operator will make subsequent use of indexes impossible. However, $match, $limit, $sort, $skip (there might be others?) can be used at the start of the pipeline and essentially will be logically combined to make use of an appropriate index Another spot which could use clarification is the warning at the end of this page: http://docs.mongodb.org/manual/reference/aggregation/sort/#_S_sort
We need to be sure people understand that a $sort after any $project or $unwind will have to be in memory, and that $sort must be at the start (or close to the start of the pipeline as described above). These are the two examples I am most familiar with, but there may be more. |