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

[CQF] A SargableNode should be generated for an $elemMatch on a complex path

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • QO 2022-10-03, QO 2022-10-17, QO 2022-10-31

      The following predicate should generate a Sargable node after optimization:

      {"a.histogram.path": {$elemMatch: {$eq: 42}}} 

      However, this is the generated ABT:

      Root []                                 
      |   |   projections:                              
      |   |       scan_0                                 
      |   RefBlock:                                     
      |       Variable [scan_0]                                            
      Filter []                                          
      |   EvalFilter []
      |   |   Variable [scan_0]
      |   PathGet [a]
      |   PathTraverse [1]
      |   PathGet [histogram]
      |   PathTraverse [1]
      |   PathGet [path]
      |   PathComposeM []
      |   |   PathArr []
      |   PathTraverse [1]
      |   PathCompare [Eq]
      |   Const [42]
      Scan [test]
          BindBlock:
              [scan_0]
                  Source [] 

       

       

            Assignee:
            david.percy@mongodb.com David Percy
            Reporter:
            alya.berciu@mongodb.com Alya Berciu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: