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

Use multikey metadata for more precise array estimation

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • Query Optimization

    Description

      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.

      Attachments

        Activity

          People

            backlog-query-optimization Backlog - Query Optimization
            timour.katchaounov@mongodb.com Timour Katchaounov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: