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

Number of docsExamined is not considered for index selection

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Critical - P2
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Backlog
    • Component/s: Querying

      Description

      We should consider the number of documents scanned between different plans being evaluated. At the very least, we should use that to resolve ties between plans.

      This is critical for Big Data systems reading data via Spark Connector that partitions data by _id for reading. Example:

      For the query

      {date:{$gte:A}, _id:{$gte:B}, email:{$gte:C}}
      

      all indexes below will tie, although it is beyond obvious which one should be selected (the difference is of course dramatic when we're talking about TB's of data):

      {date:1, _id:1}
      {date:1, _id:1, email:1}
      {date:1, _id:1, some_other_email:1}
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              backlog-server-query Backlog - Query Team
              Reporter:
              alex.komyagin Alexander Komyagin
              Participants:
              Votes:
              2 Vote for this issue
              Watchers:
              17 Start watching this issue

                Dates

                Created:
                Updated: