$lookup explain output missing 'indexesUsed' when using views with $unionWith

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Minor - P4
    • None
    • Affects Version/s: 8.0.9, 8.3.0-rc0
    • Component/s: None
    • None
    • Query Optimization
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When using $lookup where the foreign collection is a view that contains $unionWith, the explain output's $lookup stage does not include the all indexes in the indexesUsed field that were used in the execution of the view. This differs from executing the same pipeline without the view, where indexesUsed is properly populated, making it difficult to analyze query performance when views are involved. 

      See attached indexesUsedrepro.jsfor steps to reproduce this problem.

            Assignee:
            Unassigned
            Reporter:
            Ben Shteinfeld
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: