Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-72020

[CQF] Make sure computed fields are not redundantly pulled from storage

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Query Optimization

      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.

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            david.percy@mongodb.com David Percy
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: