[SERVER-36990] Indexed filed still exists in FETCH step Created: 05/Sep/18  Updated: 05/Sep/18  Resolved: 05/Sep/18

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: 3.4.4
Fix Version/s: None

Type: Question Priority: Major - P3
Reporter: Meng Assignee: Nick Brewer
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-18861 Queries matching null value should be... Backlog
Participants:

 Description   

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 ?



 Comments   
Comment by Nick Brewer [ 05/Sep/18 ]

ByLomo This is expected behavior; see SERVER-18653 for more details. We're tracking potential work to change this functionality in SERVER-18861.

Please note that SERVER project is for reporting bugs or feature suggestions for the MongoDB server. For MongoDB-related support discussion please post on the mongodb-user group or Stack Overflow with the mongodb tag.

-Nick

Generated at Thu Feb 08 04:44:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.