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).
- is related to
-
SERVER-34714 An $or query with children which are all trivially false incorrectly optimizes
- Closed
- related to
-
SERVER-76693 Remove todo comments from SERVER-34759
- Closed