Remon van Vliet
unread,Jan 27, 2012, 9:45:02 AM1/27/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mongodb-user
Hi,
I'm trying to run a query that has two $in clauses on a sharded
collection. Both clauses are of equal size (in terms of amount of
elements per array) and can exceed 1000. So something like :
db.col.update({a:{$in:[1, 2, ..., 1000+]}, b:{$in:[1, 2, ...,
1000+]}}, {$set:{c:1}});
For this collection the shard key is {a:1}
When I try to execute this update the server throws an error
"combinatorial limit of $in partitioning of result set exceeded
errors" (due to an assert at line 917 in queryutils.cpp). I think this
is due to the fact that it doesn't allow the amount of possible
combinations of all the $in clauses to be higher than 1000000 :
uassert( 13385, "combinatorial limit of $in partitioning of result set
exceeded", size() < 1000000 );
I'm wondering why this limitation is in place. It seems to me that
mongos can create shard specific version of this update and target it
at the apprioriate shard. E.g. :
shard1 -> db.col.update({a:{$in:[<all values in original $in that
reside on shard 1>]}, b:{$in:[1, 2, ..., 1000+]}}, {$set:{c:1}});
shard2 -> db.col.update({a:{$in:[<all values in original $in that
reside on shard 2>]}, b:{$in:[1, 2, ..., 1000+]}}, {$set:{c:1}});
...
shardN -> db.col.update({a:{$in:[<all values in original $in that
reside on shard N>]}, b:{$in:[1, 2, ..., 1000+]}}, {$set:{c:1}});
From there on it should be the same as a query on a non-sharded
collection and that does seem to work for the same query regardless of
the sizes of the $in clauses.
Is there a reason for this limitation?