-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 4.0.16
-
Component/s: Index Maintenance, Performance, Query Execution
-
None
-
ALL
-
When using a partialFilterExpression with an $eq condition, MongoDB may fetch the document only to read the field of the $eq condition of the the partialFilterExpression. However, fetching the value should be superfluous because the value is already known by the partialFilterExpression.
This is an undesired behaviour because it fetches uselessly documents from the disk which makes the query slow (especially, if documents are bigger).
To circumvent the issue, you'd need to add the field of the $eq condition of the partialFilterExpression to the index. However, this makes the index bigger and as such it will uses more resources.
- is related to
-
SERVER-28889 Partial index shouldn't do fetch on conditions that are true by the definition of the index
- Closed