-
Type: Task
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Optimization
cqf_explain.js is failing on this query with a $natural hint because it expects an EOF plan, but the explain stages include ROOT,FILTER,COLLSCAN. With parameterization on by default, we'll generate this COLLSCAN plan without inferring anything else in the index metadata that could lead to a different plan.
const contradictionColl = db.contradictionColl;
contradictionColl.drop();
// The queries below against this collection will hint a collection scan, so they will go
// through Bonsai. The index metadata information will tell us that a is non-multikey so the
// query is a contradiction and will therefore result in an EOF plan. Note that we need to
// explicitly allow the query to go through saragable rewrites since by default M2 queries do
// not go through them.
contradictionColl.insert({a: 10});
contradictionColl.createIndex({a: 1});
// Contradiction plan results in EOF plan, find.
analyzeFindExplain(db,
contradictionColl,
["EOF"] /* expectedStandaloneStages */,
["EOF"] /* expectedShardedStages */,
null /* expectedDir */,
isSharded,
{$and: [\{a: 2}, \{a: 3}]} /* query */,
{} /* projection */,
{$natural: 1} /* hint */,
false /* disableSargableRewrites */);
Investigate the root cause, and turn parameterization back on in this test once fixed.
- is related to
-
SERVER-85454 Adjust cqf tests to account for parameterization
- Closed