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

Queries matching null value should be fully covered by index

    • Query Optimization
    • Query Optimization 2021-02-22, Query Optimization 2021-03-08

      Because of issue closing SERVER-18653 I open a feature request for the important improvement.

      Assume, we have a collectoin with documents like

      {}, {a:1}, {a:[]}, {a:null}

      Also we have an non sparse index on "a" field.

      If we query all documents where a doesnt exist or null with {a: null}, an engine always fetches documents even having field indexed.

      Need to improve query planner to allow query null valued field and to build an index which can detect collisions with array values.

            19 Vote for this issue
            50 Start watching this issue