[SERVER-1506] when sharding on a and need an index on a,b allow only a,b index Created: 28/Jul/10 Updated: 21/Aug/12 Resolved: 15/Jun/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | None |
| Fix Version/s: | 2.1.2 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Eliot Horowitz (Inactive) | Assignee: | Kevin Matulef |
| Resolution: | Done | Votes: | 9 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||
| Comments |
| Comment by Ian Whalen (Inactive) [ 15/Jun/12 ] |
|
Resolved with additional tests to be made covered by |
| Comment by Kevin Matulef [ 14/Jun/12 ] |
|
An implementation of this feature is now in. At any given time, you just need to have at least one "useful" index that contains the shard key as a prefix. There is one caveat: for an index to be considered "useful" it must not be a multi-key index. So to use the "a,b" index you must make sure there are no muli-key (array) values for b. If you ever do insert array values and run out of useful indices, then you won't be able to do any splits/migrates until a useful index is created (you can always create one on the shard key itself). I created a separate ticket to support multikey indices here: |
| Comment by auto [ 14/Jun/12 ] |
|
Author: {u'date': u'2012-06-14T09:54:02-07:00', u'email': u'matulef@10gen.com', u'name': u'Kevin Matulef'}Message: |
| Comment by Andy Schwerin [ 17/May/12 ] |
|
@kevin, do you think you can get this done for 2.1.2, along w/ |
| Comment by Jon Hoffman [ 23/Jan/12 ] |
|
is there an eta for this yet? |
| Comment by Eliot Horowitz (Inactive) [ 01/Nov/11 ] |
|
As of now, yes. |
| Comment by Jon Hoffman [ 31/Oct/11 ] |
|
Is this still in for 2.1.1? |
| Comment by Eliot Horowitz (Inactive) [ 03/Aug/11 ] |
|
There are more edge cases here than is possible to fully test before 2.0 |
| Comment by Eliot Horowitz (Inactive) [ 06/Jun/11 ] |
|
@javier That's the idea. |
| Comment by Javier Ferrero [ 06/Jun/11 ] |
|
Furthermore, if I have a compound index on A B C where: A is constant. Could I use the index as a compound shard key on A B? |
| Comment by Javier Ferrero [ 06/Jun/11 ] |
|
Would this work with compound shard keys? Say I have a compound index on A B C. Can I use that index for a shard key on A B? |
| Comment by Eliot Horowitz (Inactive) [ 07/Mar/11 ] |
|
Its a very simple theoretical change, just a fair number of touch points in the code. |
| Comment by Harry [ 06/Mar/11 ] |
|
Would love to see this fixed (and possibly backported to 1.8)? |