-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Labels:None
Description
Description:
This following topic needs an update: https://docs.mongodb.com/master/reference/explain-results/
The queryPlanner output may include a new field 'optimizedPipeline: true' to indicate that this plan represents an aggregation request where the pipeline has been optimized away and the request is answered using the query engine only. Note that this is either 'optimizedPipeline: true' or no field at all. That is, 'optimizedPipeline: false' can never appear in the output. Here is an example:
"queryPlanner" : {
"plannerVersion" : <int>,
"namespace" : <string>,
"indexFilterSet" : <boolean>,
"parsedQuery" :Unknown macro: { ... },
"queryHash" : <hexadecimal string>,
"planCacheKey" : <hexadecimal string>,
"optimizedPipeline" : true,Engineering Ticket Description:
An aggregation pipeline can be used to represent a query, like the following:
db.example.aggregate([{$project: {excluded: 0}}, {$match: {predicate: true}}]);In these cases, it would be more efficient to skip the aggregation layer, and execute the entire computation using a query.
It is expected that pipelines like the above pipeline will be much more common once non-materialized views are introduced in
SERVER-142.
Scope of changes
Impact to Other Docs
MVP (Work and Date)
Resources (Scope or Design Docs, Invision, etc.)
- documents
-
SERVER-24860 Optimize away entire pipeline if it can be answered using a query
- Closed