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

Rewrite single-field disjunctions to eqMember, consolidate eqMember

    • Type: Icon: Task Task
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Query Optimization

      When skipping the Filter->Sargable transformation, the optimizer doesn't generate partial schema requirements, and consequently doesn't callĀ 
      PartialSchemaReqLowerTransport which in turn would call consolidateEqDisjunctions(). As a result not all disjunctions are consolidated into a single eqMember. This task should:

      • Rewrite disjunctions of the form: {$or: [ {a: 1}

        , {a: 2}, {b: 3}]} into eqMember.

      • Consolidate eqMember on the same field into one eqMember.
      • Remove duplicate members.

      The potential performance benefit of this rewrite should come from:

      • potentially removing duplicate disjunctions
      • reducing the size of the SBE plan, and using a single traverseF with a single isMember instead of multiple traverseF for each equality.

      This rewrite could be done as part of a more general simplification.

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            timour.katchaounov@mongodb.com Timour Katchaounov
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: