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

Rewrite single-field disjunctions to eqMember, consolidate eqMember

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • Query Optimization

    Description

      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.

      Attachments

        Activity

          People

            backlog-query-optimization Backlog - Query Optimization
            timour.katchaounov@mongodb.com Timour Katchaounov
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: