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

Exploit RID = _id for secondary index on clustered collections?

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Query Optimization

      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}}?

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            david.percy@mongodb.com David Percy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: