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

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

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

      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.

            Assignee:
            charlie.swanson@mongodb.com Charlie Swanson
            Reporter:
            charlie.swanson@mongodb.com Charlie Swanson
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: