-
Type: Task
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
-
Query Execution
When determining the merging shard for an aggregation with a $lookup whose 'from' collection is a view, we find that there is no routing table for the view. As a result, we default to merging on the db primary. This ticket tracks the work to handle view resolution when picking a merging shard.
Note that while a view does not have a routing table entry, the underlying collection does. However, we do not resolve this view to the underlying collection until we issue an aggregate against the inner side (which occurs after we've created a distributed plan and picked a merging shard for the top level aggregate).
Note also that this might be tricky to do without tracking views in the sharding catalog.