[SERVER-21441] Optimize shard targeting for equality queries on the shard key Created: 12/Nov/15  Updated: 25/Nov/15  Resolved: 17/Nov/15

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

Type: Improvement Priority: Major - P3
Reporter: David Storch Assignee: David Storch
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-20596 Performance regression in new mongos ... Closed
Backwards Compatibility: Fully Compatible
Sprint: QuInt C (11/23/15)
Participants:

 Description   

The shard targeting process is fairly heavy-weight. It involves running all query planning logic using QueryPlanner::plan(), and then analyzing the plan to determine the shard key ranges represented by the query.

For the special case of equality on the shard key, we don't have to plan the entire query. Instead, we can simply extract the shard key value from the query, look up the corresponding chunk, and determine the shard on which that chunk resides. Performance testing has shown an overall performance benefit of 6-7% associated with this change for equality-on-shardkey queries.



 Comments   
Comment by Githook User [ 17/Nov/15 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-21441 faster shard targeting for equality queries on the shard key
Branch: master
https://github.com/mongodb/mongo/commit/8c0443a33249b3aec2f94fc97017e1314ef3d53f

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