Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-85533

Investigate overlap between parameterization and shard targeting

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 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.

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            lynne.wang@mongodb.com Lynne Wang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: