[SERVER-79854] [CQF] Omit shard filtering stage when query has an equality predicate on the shard key Created: 08/Aug/23  Updated: 29/Oct/23  Resolved: 06/Sep/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.2.0-rc0

Type: Task Priority: Major - P3
Reporter: Ben Shteinfeld Assignee: Ben Shteinfeld
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Issue split
split from SERVER-78507 [CQF] Satisfy RemoveOrphansRequiremen... Closed
Related
related to SERVER-80824 Complete TODO listed in SERVER-79854 Closed
Assigned Teams:
Query Optimization
Backwards Compatibility: Fully Compatible
Sprint: QO 2023-09-04, QO 2023-09-18
Participants:

 Description   

We can omit shard filtering when the query contains an equality predicate on all fields of the shard key because all documents are guaranteed to be owned by this shard.

We can modify the implementer for SargableNode to perform this optimization when the node is being optimized with RemoveOrphansRequirement.



 Comments   
Comment by Githook User [ 06/Sep/23 ]

Author:

{'name': 'Ben Shteinfeld', 'email': 'ben.shteinfeld@mongodb.com', 'username': 'bshteinfeld'}

Message: SERVER-79854 [CQF] Omit shard filter on equality to shard key

Implement the classic engine optimization which avoids a shard filter stage when the predicate contains an exact equality on all components of the shard key in Bonsai.
Branch: master
https://github.com/mongodb/mongo/commit/73822b5156502248e29dac1410fd3e48c1a68657

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