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

Heuristic CE for FilterNode with a Boolean expression over comparison predicates

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 6.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Fully Compatible
    • QO 2022-08-08, QO 2022-08-22

      Implement heuristic CE for FilterNode that contains a Boolean path expression of comparison operations. Boolean expressions inside a FilterNode are expressed via PathComposeM (AND), and PathComposeA (OR) nodes. This task should implement a transport that walks such path expression trees, and:

      • given an atomic comparison predicate uses Heuristic CE,
      • given a conjunction/disjunction applies exponential backoff estimation via bottom-up recursion.

      This one example of a disjunction:

      Query: {$or: [{a0: {$gt:44}}, {a0: {$lt: 9}}]}
      
      Root []
      |   |   projections: 
      |   |       scan_0
      |   RefBlock: 
      |       Variable [scan_0]
      Filter []
      |   EvalFilter []
      |   |   Variable [scan_0]
      |   PathComposeA []
      |   |   PathGet [a0]
      |   |   PathTraverse []
      |   |   PathComposeM []
      |   |   |   PathCompare [Gte]
      |   |   |   Const [nan]
      |   |   PathCompare [Lt]
      |   |   Const [9]
      |   PathGet [a0]
      |   PathTraverse []
      |   PathComposeM []
      |   |   PathCompare [Lt]
      |   |   Const [""]
      |   PathCompare [Gt]
      |   Const [44]
      Scan [test]
          BindBlock:
              [scan_0]
                  Source []
      

      This an example of more complex conjunction:

      Query: {$and : [{$or : [ {a0 : {$gt : 11}}, {a0 : {$lt : 44}} ]},{$or : [ {a0 : {$gt : 77}}, {a0 : {$eq : 51}} ]}]}
      Initial ABT:
      Root []
      |   |   projections: 
      |   |       scan_0
      |   RefBlock: 
      |       Variable [scan_0]
      Filter []
      |   EvalFilter []
      |   |   Variable [scan_0]
      |   PathComposeA []
      |   |   PathGet [a0]
      |   |   PathTraverse []
      |   |   PathCompare [Eq]
      |   |   Const [51]
      |   PathGet [a0]
      |   PathTraverse []
      |   PathComposeM []
      |   |   PathCompare [Lt]
      |   |   Const [""]
      |   PathCompare [Gt]
      |   Const [77]
      Filter []
      |   EvalFilter []
      |   |   Variable [scan_0]
      |   PathComposeA []
      |   |   PathGet [a0]
      |   |   PathTraverse []
      |   |   PathComposeM []
      |   |   |   PathCompare [Gte]
      |   |   |   Const [nan]
      |   |   PathCompare [Lt]
      |   |   Const [44]
      |   PathGet [a0]
      |   PathTraverse []
      |   PathComposeM []
      |   |   PathCompare [Lt]
      |   |   Const [""]
      |   PathCompare [Gt]
      |   Const [11]
      Scan [test]
          BindBlock:
              [scan_0]
                  Source []
      

            Assignee:
            henri.nikku@mongodb.com Henri Nikku
            Reporter:
            timour.katchaounov@mongodb.com Timour Katchaounov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: