Query hits tassert due to inferred self-edges

XMLWordPrintableJSON

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

      When running this query:

      db.results.aggregate([
          {$lookup: {from: "base_other", localField: "key", foreignField: "key", let: {f: "$cor.key.foo"}, pipeline: [{$match: {$expr: {$eq: ["$key", "$$f"]}}}], as: "lf"}}, 
          {$unwind: "$lf"}
      ]) 

      I saw a tassert during edge inference because we try to construct a self-edge.

      Using loose terminology, I image we see that (local) key == base_other.key AND (local) cor.key.foo $== base_other.key, so then we infer that (local) key == (local) cor.key.foo. That’s correct! Even though it doesn’t help us with our join plan, it’s a valid (single table) predicate to infer.

      This ticket is related to SERVER-117816, and may in fact be addressed at the same time as that ticket. But, I’m tracking it separately because it represents a bug in our existing implementation.

            Assignee:
            Unassigned
            Reporter:
            Hana Pearlman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: