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

Exploit RID = _id for secondary index on clustered collections?

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None
    • Query Optimization

    Description

      If I understand correctly, on a clustered collection the _id field is the same as the record ID (RID). Does this mean that any secondary index also includes the _id value? For example, an index on {a: 1} is really a set of (a, _id) entries, almost like an index on {a: 1, _id: 1}.

      Could we use an {a: 1} index to satisfy queries like {$sort: {a: 1, _id: 1}}?

      Attachments

        Activity

          People

            backlog-query-optimization Backlog - Query Optimization
            david.percy@mongodb.com David Percy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: