[SERVER-85533] Investigate overlap between parameterization and shard targeting Created: 22/Jan/24  Updated: 30/Jan/24

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Lynne Wang Assignee: Backlog - Query Optimization
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-85454 Adjust cqf tests to account for param... Closed
Assigned Teams:
Query Optimization
Participants:

 Description   

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.


Generated at Thu Feb 08 06:57:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.