[SERVER-80240] Additions to Bonsai const folding Created: 18/Aug/23  Updated: 23/Jan/24

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

Type: Task Priority: Major - P3
Reporter: Alya Berciu Assignee: Backlog - Query Optimization
Resolution: Unresolved Votes: 0
Labels: M9
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-79367 Optimize projections in Bonsai Closed
Assigned Teams:
Query Optimization
Sprint: QO 2024-01-08
Participants:

 Description   

Split out from SERVER-79367 since they could be more generally useful. See that ticket for a summary of the original motivation.

Current approach is to do rudimentary type detection, and apply simplifications when we know the output types:

  • isObject(<known type>) -> true/false (can do similar for isArray/exists)
  • setField(<const object/var -> const object>, "field", <value>) -> newObj(<fields from const obj>, "field", value)
  • setField(newObj(...), "field", <value>) -> newObj(..., "field", <value>)

Generated at Thu Feb 08 06:43:02 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.