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

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

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

      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:
            backlog-query-integration [DO NOT USE] Backlog - Query Integration
            Reporter:
            charlie.swanson@mongodb.com Charlie Swanson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: