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

Use multikey metadata for more precise array estimation

    • Type: Icon: Task Task
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Optimization

      The optimizer collects metadata about path multikeyness (whether a path contains arrays).

      This metadata is available via the method ScanDefinition::getNonMultiKeyPathSet() that returns all paths that do NOT contain arrays.

      This task should use this metadata to improve cardinality estimation in the cases when such metadata is available. This metadata has priority over statistics - that is, if statistics says there are arrays, but the metadata says there aren't, we trust the metadata. Normally this shouldn't happen.

      We can also use this information for heuristic estimation, for instance a query that uses an array comparison value will return 0 matches if there are no arrays.

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            timour.katchaounov@mongodb.com Timour Katchaounov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: