[SERVER-80239] [CQF] Re-consider comparison against missing fields (Nothing semantics) in ABT Created: 18/Aug/23  Updated: 25/Sep/23

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Hana Pearlman Assignee: Backlog - Query Optimization
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-79205 [CQF] $not $eq array, on a missing fi... Open
related to SERVER-80235 [CQF] Lower PathCompare [eq] using cmp3w Closed
is related to SERVER-81376 [CQF] Disable NotPushdown by default Closed
Assigned Teams:
Query Optimization
Participants:

 Description   

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


Generated at Thu Feb 08 06:43:02 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.