[SERVER-44773] Optimise queries to cover on sharded clusters when using compound hashed index Created: 21/Nov/19  Updated: 29/Oct/23  Resolved: 22/Jan/20

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

Type: Improvement Priority: Major - P3
Reporter: Arun Banala Assignee: Arun Banala
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Query 2020-01-13, Query 2020-01-27
Participants:

 Description   

When compound hashed shard key has a range prefix, if the query predicate is on the prefix and the projection doesn't include hashed fields then the query can be covered.

The current behaviour for hashed shard keys is, we always fetch the documents on the shards to make sure that the document is not an orphan. When the projection and query doesn't include hashed fields, the document fetch can be avoided.



 Comments   
Comment by Githook User [ 22/Jan/20 ]

Author:

{'username': 'banarun', 'name': 'Arun Banala', 'email': 'arun.banala@mongodb.com'}

Message: SERVER-44773 Optimise queries to cover on sharded clusters when using compound hashed index

create mode 100644 jstests/sharding/compound_hashed_shard_key_covered_query.js
Branch: master
https://github.com/mongodb/mongo/commit/ef35c34b92e50e0438abeb2ffc83ff1472dd7d64

Comment by David Storch [ 22/Nov/19 ]

arun.banala can you provide a description for this ticket? Thanks!

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