-
Type:
Improvement
-
Resolution: Won't Do
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Optimization
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
Currently the cost of EvaluationNode is a function of its child's cardinality estimate, the startup cost + marginal cost coefficients. The number/depth of path elements in the node is not considered.
This led to confusion in the implementation of SERVER-79034, see discussion here, where two alternatives were computed to have identical cost, despite one plan known to be better.
Here are some simplified plan snippets which demonstrate the problem. Both plans generate a projection for "a.b", one doing as an explicit projection while the other pushing the projection of "a" into the PhysicalScan. But both have the same cardinality estimates and the same number of Evaluation nodes, and thus end up with the same cost.
Evaluation [{proj_a_b}]
| EvalPath []
| | Variable [root]
| PathGet [a]
| PathGet [b]
| PathIdentity
PhysicalScan [{'<root>': root}]
Evaluation [{proj_a_b}] | EvalPath [] | | Variable [proj_a] | PathGet [b] | PathIdentity PhysicalScan [{'<root>': root, 'a': proj_a}]
- is related to
-
SERVER-76272 Improve cost model for Filter and Evaluation nodes
-
- Closed
-
-
SERVER-79635 [CQF] Consider the number of projections produced by a PhysicalScan when determining its cost
-
- Closed
-