[SERVER-2104] covered index should support dotted fields Created: 16/Nov/10  Updated: 08/Feb/18  Resolved: 24/Feb/17

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 3.5.4

Type: Improvement Priority: Major - P3
Reporter: Eliot Horowitz (Inactive) Assignee: David Storch
Resolution: Done Votes: 50
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-192 query that just returns value in inde... Closed
Documented
Duplicate
is duplicated by SERVER-5775 index-only query apparently not execu... Closed
is duplicated by SERVER-6253 Covered index not working on sub docu... Closed
is duplicated by SERVER-8659 Allow projections with dotted fields ... Closed
is duplicated by SERVER-12469 Allow subdocuments to be used in cove... Closed
Related
is related to SERVER-23561 Distinct on sub-documents array doesn... Closed
is related to SERVER-23582 Query planner should not generate DIS... Closed
Backwards Compatibility: Fully Compatible
Sprint: Query 2017-03-06
Participants:
Case:

 Comments   
Comment by Githook User [ 24/Feb/17 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-2104 add support for covered projections with dotted field paths

For example, suppose you have index

{"a.b": 1}

. The
projection {_id: 0, "a.b": 1} will now result in a covered
plan when this index is used.
Branch: master
https://github.com/mongodb/mongo/commit/73d37b8fc33a3c429dfd21ad305b2c355c2a9828

Comment by Githook User [ 24/Feb/15 ]

Author:

{u'username': u'kerneljake', u'name': u'Jake Angerman', u'email': u'kerneljake@users.noreply.github.com'}

Message: Update query-optimization.txt

The word "returned" implies that you can workaround this limitation using a projection, but in fact you cannot (per SERVER-2104).

Conflicts:
source/core/query-optimization.txt
Branch: v2.4
https://github.com/mongodb/docs/commit/8240f1f49fbd4e1ae880f2042c49928f64031c9f

Comment by Githook User [ 24/Feb/15 ]

Author:

{u'username': u'kerneljake', u'name': u'Jake Angerman', u'email': u'kerneljake@users.noreply.github.com'}

Message: Update query-optimization.txt

The word "returned" implies that you can workaround this limitation using a projection, but in fact you cannot (per SERVER-2104).

Signed-off-by: kay <kay.kim@10gen.com>
Branch: master
https://github.com/mongodb/docs/commit/104015f5ed56c2c6e91f1c0c3c9e4967fab6886b

Comment by Githook User [ 24/Feb/15 ]

Author:

{u'username': u'kerneljake', u'name': u'Jake Angerman', u'email': u'kerneljake@users.noreply.github.com'}

Message: Update query-optimization.txt

The word "returned" implies that you can workaround this limitation using a projection, but in fact you cannot (per SERVER-2104).
Branch: v2.6
https://github.com/mongodb/docs/commit/4000f08dfe8da1e8489205ae76f6e9bea1fbaf9c

Comment by Asya Kamsky [ 15/Jan/15 ]

This ticket is for covered indexes for subdocuments only (not arrays) and the projection for the query must be returning only the indexed subfield (from the subdocument).

Comment by Alexander Conrad [ 14/Jul/14 ]

Just wanted to mention that we're still experiencing this issue as of 2.6.3 . Specifically, queries in our system which utilize an index incorporating subdocument fields are never able to be fully covered by the index, which we believe is contributing to a few slowdowns within our system and may eventually necessitate schema redesign.

As an aside, it may be helpful for future users to include and emphasize in the official Mongo documentation this limitation of indexing on subdocument fields and its implications.

Comment by auto [ 16/Nov/10 ]

Author:

{'login': 'erh', 'name': 'Eliot Horowitz', 'email': 'eliot@10gen.com'}

Message: safety for Projection's current state SERVER-192 SERVER-2104
/mongodb/mongo/commit/598af81eaa74d1ee0a398b48f3c8174c7e643098

Generated at Thu Feb 08 02:58:59 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.