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

Indexed filed still exists in FETCH step

    • Type: Icon: Question Question
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.4.4
    • Component/s: Index Maintenance
    • None

      I have a compound index:

       

      { 
          field1: 1, 
          field2: 1, 
          field3: 1 
      }

      When I do a query:

      { 
          field1: { $in: ['A', 'B'] },
          field2: { $in: ['C', 'D'] },
          field3: null
      }

      which hit the index field1_1_field2_1_field3_1, and in executionStats' IXSCAN step, field3's range is [null, null].

      BUT, { field3:

      { $eq: null }

      } exists in FETCH step ??? I have indexed it and use it in IXSCAN step, why mongo need to filter it again ?

            Assignee:
            nick.brewer Nick Brewer
            Reporter:
            ByLomo Meng
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: