[SERVER-10403] sparse compound index should really be sparse Created: 01/Aug/13 Updated: 26/Sep/17 Resolved: 25/Sep/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Index Maintenance |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Antoine Girbal | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 12 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||
| Case: | (copied to CRM) | ||||||||||||||||||||||||
| Description |
|
I've always believed from documentation that only single field sparse index were supported.
I feel like the behavior is not useful at all: it's rare that all fields are absent and thus it mostly behaves like a non-sparse.
Say I'm working on reconciliation software: 99% of my records are matched and 1% non matched. and obtain an index that's 99% smaller. |
| Comments |
| Comment by Asya Kamsky [ 25/Sep/15 ] | |||||||||||||||||
|
Functionality covered in SERVER-785 | |||||||||||||||||
| Comment by Johnny Shields [ 10/Jul/14 ] | |||||||||||||||||
|
I like the proposal in this issue the best. I don't think there needs to be a separate SparsePolicy / StrictSparse option. Sparse indices on compound keys are essentially useless at the moment. | |||||||||||||||||
| Comment by Kevin Locke [ 16/May/14 ] | |||||||||||||||||
|
When searching the bug tracker I noticed Perhaps the issues should be merged or marked as related? | |||||||||||||||||
| Comment by Antoine Girbal [ 13/Aug/13 ] | |||||||||||||||||
|
renctan In your output as soon as either x or y is specified, it will make it into the index. Ideally if any key is non-existent, record would not make it to sparse index. I understand we are unlikely to change this because it would probably be backward breaking, but really it would make the sparse index much more powerful as laid out in my description. | |||||||||||||||||
| Comment by Randolph Tan [ 13/Aug/13 ] | |||||||||||||||||
|
antoine I just tried this in the mongo shell on the master branch. Does this behavior match the desired behavior?
|