Exploit RID = _id for secondary index on clustered collections?

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Won't Do
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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:
            [DO NOT USE] Backlog - Query Optimization
            Reporter:
            David Percy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: