[SERVER-14070] Compound index not providing sort if equality predicate given on sort field Created: 27/May/14 Updated: 16/Jul/15 Resolved: 12/Dec/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | None |
| Fix Version/s: | 2.6.11, 2.8.0-rc3 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | J Rassi | Assignee: | David Storch |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Backport Completed: | |||||||||
| Participants: | |||||||||
| Description |
|
Queries that can use a compound index to provide a sort on a subset of fields in the key pattern are sometimes given an unnecessary in-memory sort if an equality predicate is given on the sort field. Reproduce with:
|
| Comments |
| Comment by Githook User [ 16/Jul/15 ] | |||||||||||||||
|
Author: {u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}Message: (cherry picked from commit 5120700460ef7a3240603a4307a0b1be2c358c3c) | |||||||||||||||
| Comment by Githook User [ 12/Dec/14 ] | |||||||||||||||
|
Author: {u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}Message: | |||||||||||||||
| Comment by Githook User [ 12/Dec/14 ] | |||||||||||||||
|
Author: {u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}Message: | |||||||||||||||
| Comment by J Rassi [ 27/May/14 ] | |||||||||||||||
|
I presume that the same issue is affecting the following set of examples also, in which specifying an equality predicate on the sort field is preventing the "explode for merge sort" logic from being applied:
|