-
Type: Task
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Optimization
In this ticket, we will decide how best to handle comparisons against missing fields in CQF, not just for the specific query from the linked ticket but for a broader slice of MQL. It helps to look at an example:
The NotPushdown optimization can lead to differing result sets between classic and CQF (SERVER-79205). For example, the rewrite can make the following transformation.
explain : Root [{p0}] Filter [] | UnaryOp [Not] EvalFilter [] | | Variable [p0] | PathGet [a] PathCompare [Eq] Const ["a"] Scan [coll, {p0}] ==> explain : Root [{p0}] Filter [] | EvalFilter [] | | Variable [p0] | PathGet [a] PathCompare [Neq] Const ["a"] Scan [coll, {p0}]
The issue arises when field "a" is missing. The first ABT currently matches the document (consistent with classic) while the second ABT does not-- see the linked ticket for more details on the behavior. It is likely that we will want to match the classic behavior above, since it is well documented. But there are several ways to achieve this behavior in CQF: we could always disable NotPushdown, we could use different primitives to implement the comparison operators, we could change how we model comparisons in ABT, etc etc. In this ticket we will decide which of these approaches is best keeping in mind SBE and ABT design principles
- is related to
-
SERVER-81376 [CQF] Disable NotPushdown by default
- Closed
- related to
-
SERVER-79205 [CQF] $not $eq array, on a missing field, should return true
- Closed
-
SERVER-80235 [CQF] Lower PathCompare [eq] using cmp3w
- Closed