-
Type: Bug
-
Resolution: Fixed
-
Priority: Critical - P2
-
Affects Version/s: 4.2.7
-
Component/s: Index Maintenance, Querying
-
None
-
Fully Compatible
-
ALL
-
v4.4, v4.2
-
-
Query 2020-06-15, Query 2020-06-29
We had an issue where a query on a collection containing a wildcard index seemingly randomly returned zero results, even though matching objects existed. The issue first arose one days after introducing wildcard indexes, so a causal relation seemed likely.
The problem seems to arise if a first query successfully filters for a non-null value using the wildcard index...
filter: { value1: 1.0, value2: 1.0, value3: 1.0, deleted: null }
planSummary: IXSCAN { $_path: 1, value3: 1 }
And then a second nearly identical query filters for null on the same field...
filter: { value1: 1.0, value2: 1.0, value3: null, deleted: null } planSummary: IXSCAN { $_path: 1, value3: 1 }
Seemingly, the query planner simply reuses the plan from the first query, not realizing that the wildcard index is sparse by definition.
- related to
-
SERVER-48700 Add fuzz testing to ensure that the plan cache preserves query correctness
- Closed