Rewrite single-field disjunctions to eqMember, consolidate eqMember

XMLWordPrintableJSON

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

      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:
              [DO NOT USE] Backlog - Query Optimization
              Reporter:
              Timour Katchaounov
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: