mongodb-d4
mongodb-d4 copied to clipboard
Selection of range sharding against hash sharding
trafficstars
MongoDB now supports hash shard keys. In some cases, hash sharding has better performance than range sharding(e.g. most queries' predicates are equality). So D4 should implement the selection of range sharding against hash sharding.
In order to do this, we need to add a field to src/search/design.py, which indicates what sharding strategy that design is using.
Then in the cost model, we need to adapt to different sharding strategy. So method computeTouchedNode in src/costmodel/nodeestimator.py should be adapted to these changes.