Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-83902

Check for views when determining a merging shard during cluster aggregate planning

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 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.

            Assignee:
            backlog-query-execution [DO NOT USE] Backlog - Query Execution
            Reporter:
            mihai.andrei@mongodb.com Mihai Andrei
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: