-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Optimization
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Consider projection_ast::Projection and projection_executor::ProjectionExecutor classes.
Projection AST is a logical representation of a projection.
ProjectionExecutor is an execution class that accepts an AST can can execute it on a document in Classic engine.
Currently both have optimize() methods that traverse the projection tree and call optimize() on any expressions found:
AST:
This seems like a needless code duplication.
Because ProjectionExecutor is purely execution class, we must consider to remove optimization logic from it.
Maybe it is better if it will execute an AST exactly as given and we should ensure that we always construct it from already optimized AST.