[SERVER-5165] investigate lack of type bracketing in shard selection code Created: 01/Mar/12  Updated: 11/Jul/16  Resolved: 02/May/14

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: None

Type: Question Priority: Major - P3
Reporter: Aaron Staple Assignee: Siyuan Zhou
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-4555 check and clean sharding utilization ... Closed
Participants:

 Description   

Many indexed queries are bracketed by data type. For example the index bounds for { a:

{ $gt:0 }

} are

	"indexBounds" : {
		"a" : [
			[
				0,
				1.7976931348623157e+308
			]
		]
	},

The max value of a we will scan is 1.7976931348623157e+308, not maxKey. When determining which shards a query should be sent to, though, we do not perform type bracketing. The queryutil code implements a special mode that disables bracketing just for this case. It would be helpful to understand why type bracketing is disabled.

    void ChunkManager::getShardsForQuery( set<Shard>& shards , const BSONObj& query ) const {
        OrRangeGenerator org(_ns.c_str(), query, false);

(The 'false' argument disables type bracketing.)



 Comments   
Comment by Siyuan Zhou [ 02/May/14 ]

Fixed in SERVER-13656.

Comment by auto [ 22/Mar/12 ]

Author:

{u'login': u'astaple', u'name': u'Aaron', u'email': u'aaron@10gen.com'}

Message: SERVER-5165 Fix comment.
Branch: master
https://github.com/mongodb/mongo/commit/8b7859835387ff9d31416caa5916d12d9408a8fb

Comment by Greg Studer [ 02/Mar/12 ]

I can't think of a reason that the semantics for determining where to send a query should be different from how that query is actually processed - but I'm not 100% sure how different types compare?

Generated at Thu Feb 08 03:08:05 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.