[SERVER-72020] [CQF] Make sure computed fields are not redundantly pulled from storage Created: 09/Dec/22  Updated: 10/Dec/22

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

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

Issue Links:
Related
related to SERVER-25120 aggregation requests generated field ... Closed
Assigned Teams:
Query Optimization
Participants:

 Description   

In the classic engine there is a bug in dependency tracking that can result in a suboptimal plan. If the query computes a field, and then depends on it later:

{$addFields: {a: ...}} ... {$project: {a: 1}}

then we redundantly pull 'a' from storage (the collection or an index).

When we implement computed fields in Bonsai, we should make sure to test this case.


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