Try not to call planShardedSearch on mongos if we will not need to merge results (unsharded or single shard)

XMLWordPrintableJSON

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

      InĀ SERVER-85694 we saw a bug here which was pretty hard to track down due to the unintuitive nature of how this works. In this ticket we suggest trying out:

      • Clear lifecycle phases for a sharded $search or $searchMeta. For example, it is parsed as $search and only in 'distributedPlanLogic' would it call 'planShardedSearch'. With that done, it would stop being a $search and become a $internalSearchMongotRemote plus the merging pipeline.
      • removing the special cases for 'pExpCtx->needsMerge' from $internalSearchMongotRemote and friends. It should be clear from the setup of the stages whether you need to merge or not.

            Assignee:
            [DO NOT USE] Backlog - Query Integration
            Reporter:
            Charlie Swanson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: