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

Add query knob to enumerate $or children in a different order

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.6.6, 4.0.0
    • Fix Version/s: 4.2.10, 4.7.0, 4.4.2, 4.0.21
    • Component/s: Querying
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Backport Requested:
      v4.4, v4.2, v4.0, v3.6
    • Sprint:
      Query 2020-08-24, Query 2020-09-07

      Description

      As described in SERVER-36393 there are cases where we fail to enumerate some interesting plans because we limit the number of plans we generate for a contained $or. While not a complete solution, one suggestion for a workaround on that ticket was to add a way to enumerate the children of the $or in a different "more interesting" order. To quote:

      Asya points out that our plan enumeration code might fall over like this less if it changes its enumeration strategy from something like:
      A, A, A
      A, A, B
      A, A, C
      ...
      To something like
      A, A, A
      B, B, B
      C, C, C
      ...
      This is a heuristic that might help us to force the plan selection code to consider the best index in more cases, short of a more complete solution.

      This ticket tracks the work to implement that solution.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              charlie.swanson Charlie Swanson
              Reporter:
              charlie.swanson Charlie Swanson
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: