[Join Optimization] Avoid enumerating knowably bad INLJ plans

XMLWordPrintableJSON

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

      We should avoid enumerating plans that produce a large number of probes as INLJ is typically only beneficial when performing a small number of probes into a large table.

      We can apply a heuristic that avoids enumerating an INLJ if the outer side cardinality (representing the number of probes we will perform) is larger than that of the inner side after single table predicates.

      Our cost model should be able to detect this type has a high cost and avoid picking it, but if we can, it would be even better to just avoid enumerating it in the first place. This is similar to the HashJoin pruning heuristic which avoid enumerating plans where the build side is larger than the probe side.

            Assignee:
            Max Verbinnen
            Reporter:
            Ben Shteinfeld
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: