Improve the planner to detect {$alwaysTrue: 1} to mean the same thing as {$and: []} and {}.

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 7.1.0-rc0
    • Affects Version/s: None
    • Component/s: Querying
    • Query Optimization
    • Fully Compatible
    • QO 2023-05-01
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      As part of an enhancement to the optimization explored in SERVER-34714 it was discovered that replacing the empty query with {$alwaysTrue: 1} resulted in some planning regressions.

       

      Conclusion of the discussion is that the $AlwaysTrue and $and[] should be "normalized" for all cases to {} as this is more robust in the optimizer (default case having no predicated at all). 

              Assignee:
              Peter Volk
              Reporter:
              Charlie Swanson
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: