-
Type: Improvement
-
Resolution: Won't Do
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Aggregation Framework
-
None
-
Query Optimization
-
QO 2022-09-05, QO 2022-10-03, QE 2022-10-17
When generating pipelines to handle polymorphic data, the BI-Connector creates a lot of fields that are not necessarily needed for the final output, as a simplified example:
{$addFields: {x: ..., y:..., z:...}}
{$project{OUT: "$x"}}
The code for computing y and z, which can be quite expensive, is totally unneeded. This can generalize to any number of stages. Essentially, any fields removed by $projects can be removed from computations proceeding said $project, transitively, e.g.:
{$addFields: {x: ..., y:..., z:...}} {$addFields: {a: {$add: ["$x", "$y"]}, b: {$add: ["$y", "$z"]}}} {$project{OUT: "$b"}}
Here, we can remove the computation for a, and then, transitively, x. This has the possibility to drastically improve many types of queries, but will require a field level dependency tracker. This will see benefit for any generated code, not just from the BI-Connector, so it makes more sense to be done within the server.
- is related to
-
SERVER-69361 [CQF] Extend path fusion to better handle field dependencies
- Closed
- related to
-
SERVER-69361 [CQF] Extend path fusion to better handle field dependencies
- Closed