[DOCS-6233] We should clarify that range queries on non-array fields do not work with multi-key indexes Created: 18/Sep/15  Updated: 21/Sep/17  Resolved: 17/Jul/17

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Dmitry Ryabtsev Assignee: Kay Kim (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-15086 Allow for efficient range queries ove... Closed
is related to DOCS-8120 3.4 per-field multikey tracking Closed
Participants:
Days since reply: 6 years, 30 weeks, 2 days ago

 Description   

This page: http://docs.mongodb.org/master/core/multikey-index-bounds/

It should mention the following limitation. If there is a compound multi-key index including a non-array field, then if this field is queried (and even if it's a leading field in the index and if queried alone with no array field) then MongoDB will not be able to intersect the bounds properly. And $elemMatch will not help because it is designed to work with array fields only.

The only workaround is to create a non-multi key index on the non-array field and use that for the range queries.

The situation is explained in detail in SERVER-6720.



 Comments   
Comment by Githook User [ 17/Jul/17 ]

Author:

{u'username': u'kay-kim', u'name': u'kay', u'email': u'kay.kim@10gen.com'}

Message: DOCS-6233 multikey index bounds
Branch: v3.2
https://github.com/mongodb/docs/commit/0cad3a9d3d3351427de468177495d8ae096d21a8

Comment by Githook User [ 17/Jul/17 ]

Author:

{u'username': u'kay-kim', u'name': u'kay', u'email': u'kay.kim@10gen.com'}

Message: DOCS-6233 multikey index bounds
Branch: master
https://github.com/mongodb/docs/commit/2ab6c53d97e28a6aa3b4ed8d19979d8710515cf3

Comment by Kelsey Schubert [ 12/Jul/17 ]

Yes, that's right.

Comment by Dmitry Ryabtsev [ 12/Jul/17 ]

anonymous.user, as far as I can tell SERVER-15086 is limited to WT only. Meaning it's still an issue in MongoDB v3.4 when MMAPv1 is used:

This feature is not supported for the MMAPv1 storage engine. MMAPv1 support for path-level multikey information is tracked in SERVER-22727.

And SERVER-22727 is still in the backlog.

Or am I missing something?

Comment by Kelsey Schubert [ 14/Nov/16 ]

Note that this is no longer the case in MongoDB 3.4: SERVER-15086

Generated at Thu Feb 08 07:51:53 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.