-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Minor - P4
-
None
-
Affects Version/s: 2.0.1
-
Component/s: Querying
-
None
-
Query Optimization
-
(copied to CRM)
> db.textarea.vermongo.find(); { "_id" : { "_id" : "y", "_version" : 1 }, "name" : "Thilo Planz", "_version" : 1 } > db.textarea.vermongo.find( {'_id': {'_id': 'y', '_version': 1 }}); { "_id" : { "_id" : "y", "_version" : 1 }, "name" : "Thilo Planz", "_version" : 1 } explain => "cursor" : "BtreeCursor _id_", > db.textarea.vermongo.find( {'_id._id': 'y'}); explain => "cursor" : "BasicCursor",
When using a BSONObject as the _id for the record, querying against only a part of the object should still use the _id btree index. I appreciate that because the existence and order of fields in the nested document is not known, this will not be a range scan (not even for an _id field of the nested document), but a "fast-full-index-scan" type of access path should be possible and faster than a table scan.
- is duplicated by
-
SERVER-4518 match nested fields of index keys
-
- Closed
-