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

Use empty array counter for CE for PathArr in SargableNode

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Fully Compatible
    • QO 2022-10-17

      When estimating an $elemMatch predicate, the requirements map of a Sargable node may include a special 'PathArr' predicate that signals we should estimate this field using $elemMatch semantics. This predicate may be split out into its own SargableNode during the MemoExploration phase.

      When this happens, we need a special case in order to get a correct estimate when we see a Sargable node with just a requirements map entry like PathGet "a" PathIdentity [array interval]. We should use a counter of empty arrays in statistics to obtain a reasonable estimate for the proportion of arrays we expect in the output of the SargableNode.

            Assignee:
            timour.katchaounov@mongodb.com Timour Katchaounov
            Reporter:
            alya.berciu@mongodb.com Alya Berciu
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: