[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: |
|
||||||||||||||||
| 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: 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. |