-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Execution
-
35
In SERVER-66061 we realized that we are doing some crazy stuff where a $group pipeline may generate a dependency set, pass that as a projection into the query layer, and then have the query layer optimize out that projection if/when a $group is pushed into the query layer. This seems sad and inefficient, so we have the following ideas to explore:
1) Instead of passing dependencies in as a projection, the aggregation system could pass in a new parameter which is the dependencies itself. This would communicate more clearly the intention, and make it possible to only add the projection if we don't swallow the $group.
2) Improve the interface for pushing down the $group so that we can know and decide to push a $project and/or a $group around the same time. Right now the $group is sometimes added in a callback function after we have entered the planner's getExecutorFind(). This makes it sketchy to modify the projection. This could maybe take the form of just always passing a $group into the query system, and letting it decide whether to use SBE to do the $group or to add some shim around DocumentSourceGroup or somehow indicate it was not possible. This may be crazy with library cycles.
- is related to
-
SERVER-66061 Optimize query plans using columnar indexes
- Closed
-
SERVER-67875 Complete TODO listed in SERVER-66061
- Closed