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

Send necessary information to decide whether searchScore is needed to mongot

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

      Right now mongot generates (and sorts on) searchScore for all queries. This ticket captures two improvements for removing work that mongot is currently doing.
      1. If by scanning the query we can deduce that searchScore is not used and not necessary (if it is not referenced at all in the query on standalone), it does not need to be attached to the documents (though the sort may still be necessary). For example, a query with just a $search stage in the pipeline and no other stages, or a $search followed by a $lookup. Note that in a sharded cluster we will also need to change the merge sort key if we plan on not sending searchScore to the merging node.
      2. If by scanning the query we see that the document order will be changed by an MQL stage before seeing a stage that depends on order, we should tell mongot to not sort on searchScore. For example, a $search followed by a $sort. Note that searchScore may still need to be calculated/sent, but the sort will not be necessary on mongot.

            Assignee:
            backlog-query-integration [DO NOT USE] Backlog - Query Integration
            Reporter:
            ted.tuckman@mongodb.com Ted Tuckman
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: