Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-80239

[CQF] Re-consider comparison against missing fields (Nothing semantics) in ABT

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 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

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            hana.pearlman@mongodb.com Hana Pearlman
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: