A primary goal of a Sargable node is to provide a facility for solving an access path selection problem in Bonsai. In the absense of indexes in a collection there is no need to perform this conversation as we won't be doing any access path selection work, and eventually we will get from Filter to Sargable and back to Filter node. However, a Sargable node presently participates in other optimizations, such as predicate reoredeing based on selectivity or top-level fields pushdown. If these optimizations could be "extracted" from the Sargable node and implemented as stand-alone rewrites, we could skip this rewrite when we know that we're about to generate a collection scan plan. Another interesting optimization done by the Sargable node is interval simplification (e.g., a > x && a > y becomes a > max(x, y)). However, this simplification can only be done if we know that a given path is non-multikey, and without indexes this information is not available, meaning we cannot simplify such intervlas. The only case when we can do that is a predicate within $elemMatch. We will support this case when we extend the boolean simplifier to support interval simplification so that we can perform this optimization much earlier and w/o the need to create a Sargable node.
- depends on
-
SERVER-83442 Reorder predicates in a Filter node based on selectivity
- Backlog
-
SERVER-83937 Pushdown top-level fields from EvaluationNode into PhysicalScanNode
- Backlog
-
SERVER-81973 Implement generic logic to configure which phases and rewrites to run for input query
- Closed
-
SERVER-83441 Pushdown top-level fields from FilterNode into PhysicalScanNode
- Closed
-
SERVER-83574 Rewrite single-field disjunctions to eqMember, consolidate eqMember
- Closed
-
SERVER-83839 Implement query-knob guarded logic to skip Sargable rewrites
- Closed
-
SERVER-84378 Limit the number of pushed down fields during FilterNode implementation
- Closed
- is related to
-
SERVER-79488 [CQF] Different behavior with empty-array equality (discovered by fuzzer)
- Closed
- related to
-
SERVER-84366 Incorrect selectivity in explain for complex physical plans
- Backlog