[SERVER-32764] Compound index with multi key doesn't find best solution Created: 18/Jan/18  Updated: 21/Mar/18  Resolved: 16/Feb/18

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Hayle Bell Assignee: Kelsey Schubert
Resolution: Incomplete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

If I have an index of

{a:1,b:1,c:1}

and query a=AA, b=BB, N1<c<N2, the index bounds to exactly that: a is bounded by AA, b is bounded by BB, and c is bounded by N1 and N2.

BUT if instead the index is

{a:1, b.x:1, c:1}

and query is a=AA, b.x=BB, N1<c<N2, the index only bounds a by AA, b.x by BB, and C by N1... requiring scanning to hit N2.



 Comments   
Comment by Kelsey Schubert [ 16/Feb/18 ]

Hi hbell@bluecanyontech.com,

We haven’t heard back from you for some time, so I’m going to mark this ticket as resolved. If this is still an issue for you, please provide additional information and we will reopen the ticket.

Regards,
Kelsey

Comment by Kelsey Schubert [ 19/Jan/18 ]

Hi hbell@bluecanyontech.com,

Thanks for reporting this behavior. So we can continue investigate, would you please provide some additional information?

  1. Which version of MongoDB are you running?
  2. Would you please provide the .explain() output of the query with the inefficient index bounds?

Thank you,
Kelsey

Generated at Thu Feb 08 04:31:14 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.