[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:
Depends
is depended on by SERVER-6095 make multikey indices useful for shar... Closed
Related
related to DOCS-247 Changing Shard Key Index; shard key i... Closed
related to SERVER-6107 Add more tests for sharding operation... Closed
is related to SERVER-6493 Inserting array value for non-shard-k... Closed
is related to SERVER-6809 splitVector doesn't filter additional... Closed
Participants:

 Comments   
Comment by Ian Whalen (Inactive) [ 15/Jun/12 ]

Resolved with additional tests to be made covered by SERVER-6107

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: SERVER-6095

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: SERVER-1506 change shard key validation to allow prefixes of existing indices
Branch: master
https://github.com/mongodb/mongo/commit/236c41c7766eb4d24716b4b24fd8b76bc6ebc79d

Comment by Andy Schwerin [ 17/May/12 ]

@kevin, do you think you can get this done for 2.1.2, along w/ SERVER-2001?

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.
B is constant.
C changes.

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)?
Seems like it should be straight forward?

Generated at Thu Feb 08 02:57:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.