[SERVER-81132] Avoid scanning entire routing table during $merge stage planning Created: 18/Sep/23  Updated: 27/Nov/23

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: 4.2.24, 4.4.24, 6.0.10, 5.0.21, 7.1.0-rc2
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Tommaso Tocci Assignee: Backlog - Query Optimization
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
is caused by SERVER-35905 Plug pieces together to perform a dis... Closed
Assigned Teams:
Query Optimization
Operating System: ALL
Participants:

 Description   

In SERVER-35905 we added a logic to partition a $merge stage on the shards.
This logic requires scanning the entire routing table for the collection that before 7.0+ could potentially contain millions of entry.
For collections of large number of chunks, this logic could take seconds to be executed.
Additionally, this logic is creating a vector of the size of the routing table, potentially consuming several GBs of RAM.


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