• Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      In the below test we should be able to determine that the second match does not depend on "x":

      TEST_F(PipelineDependencyGraphTest, GetTypeDoesNotSkipMatchesOnOtherBaseDocumentFields) {
          setPipeline(R"([
              {$match: {x: {$not: {$type: 'array'}}}},
              {$match: {y: {$type: 'number'}}}
          ])");
          runTest([&] {
              // Base document fields are not represented in the graph as Field nodes, so we currently
              // can't tell which stages depend on which base document fields.
              ASSERT_EQ(graph->getPossiblyNarrowingStages_forTest(nullptr, "x"),
                        (Stages{stages[0].get(), stages[1].get()}));
          });
      }
      

       

      The "missing" field has a similar problem. If two paths that were made missing by the same stage are referenced by two separate match stages, we won't be able to tell them apart and will always run type inference on both stages.

       

            Assignee:
            Unassigned
            Reporter:
            Henri Nikku
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: