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

Extend OR of COUNT_SCANs for null queries to include other types

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None
    • Query Optimization

    Description

      If we have a query of the form db.coll.count({a: null}) with a non-multikey index {a: 1}, we generate a plan that is an OR of two COUNT_SCANs, where one encodes the bound [null, null], and the other encodes the bound [undefined, undefined].

      We could extend this optimization to cover cases where we have something like db.coll.count({$or: [

      {a: null}

      , {a: ""}]}) with an OR on three COUNT_SCANS: one for null, one for undefined, and one for "". This can be applied similarly to other covered null $in intervals.

      Attachments

        Activity

          People

            backlog-query-optimization Backlog - Query Optimization
            alya.berciu@mongodb.com Alya Berciu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: