[SERVER-41418] De-couple 'Variables' from agg 'ExpressionContext' Created: 31/May/19  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Arun Banala Assignee: Backlog - Query Optimization
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Optimization
Participants:

 Description   

This is a follow up ticket to SERVER-41065, where we thought that it would make more sense to make sense to remove 'Variables' object from 'ExpressionContext'. Since 'evaluate()' uses the variables passed as the parameters, there is no value in having them in 'ExpressionContext'

As part of this ticket we can also make ExpressionContext const through out the expression tree. 'ExpressionContext' is not being modified anymore and this change should be straight forward.



 Comments   
Comment by Charlie Swanson [ 04/Jun/19 ]

As part of this, the interface for 'optimize()' will probably be affected as well. Some optimizations like constant folding need to evaluate the sub-arguments. For example, {$add: [2, 3]} will optimize to just 5. In doing so it will need to call 'evaluate' and so will need some variables.

Generated at Thu Feb 08 04:57:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.