Move custom limit pushdown for search queries to generic sharded agg limit pushdown

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Integration
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      There is a custom optimization for $search where we try to extract a limit for pushdown to the shards (similar for the $idLookup stage). This was put in place most likely because the generic limit pushdown was not triggering for search queries after the sharded facets project. Upon closer inspection, it seems possible that changing the stage constraints for $setVariableFromSubPipeline (added for sharded facets) to allow swapping with limit will enable the generic pushdown.

      Also worth noting that as of SERVER-72934, we only create the $setVariableFromSubPipeline stage if there's a reference to SEARCH_META, so we should test both scenarios.

            Assignee:
            Unassigned
            Reporter:
            Nicholas Zolnierz
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: