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

Heuristic CE for FilterNode with a single comparison predicate

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • QO 2022-07-25, QO 2022-08-08

    Description

      Estimate the cardinality of a FilterNode that represents a single comparison predicate such as

      {a: 5}

      , or {a: {$gt: 13}}.

      This task should implement logic that walks the path expression of a FilterNode, extracts the components of a comparison operation, and calls the heuristic estimation function.

      Below are a few examples of the structure of a FilterNode ABT:

      Query: {a : 123}
       
      Root []
      |   |   projections: 
      |   |       scan_0
      |   RefBlock: 
      |       Variable [scan_0]
      Filter []
      |   EvalFilter []
      |   |   Variable [scan_0]
      |   PathGet [a]
      |   PathTraverse []
      |   PathCompare [Eq]
      |   Const [123]
      Scan [test]
          BindBlock:
              [scan_0]
                  Source []
      

      The below example shows that open-ended comparisons are always completed with the lowest (in this case the empty string "") value, or the greatest value of the type. This is done to ensure correct type bracketing behavior.

      Query: {a: {$gt:44}}
      Initial ABT:
      Root []
      |   |   projections: 
      |   |       scan_0
      |   RefBlock: 
      |       Variable [scan_0]
      Filter []
      |   EvalFilter []
      |   |   Variable [scan_0]
      |   PathGet [a]
      |   PathTraverse []
      |   PathComposeM []
      |   |   PathCompare [Lt]
      |   |   Const [""]
      |   PathCompare [Gt]
      |   Const [44]
      Scan [test]
          BindBlock:
              [scan_0]
                  Source []
      

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: