Skip to content
Snippets Groups Projects
  • Tom Lane's avatar
    0140a11b
    Fix thinko in new match_join_clauses_to_index() logic. · 0140a11b
    Tom Lane authored
    We don't need to constrain the other side of an indexable join clause to
    not be below an outer join; an example here is
    
    SELECT FROM t1 LEFT JOIN t2 ON t1.a = t2.b LEFT JOIN t3 ON t2.c = t3.d;
    
    We can consider an inner indexscan on t3.d using c = d as indexqual, even
    though t2.c is potentially nulled by a previous outer join.  The comparable
    logic in orindxpath.c has always worked that way, but I was being overly
    cautious here.
    0140a11b
    History
    Fix thinko in new match_join_clauses_to_index() logic.
    Tom Lane authored
    We don't need to constrain the other side of an indexable join clause to
    not be below an outer join; an example here is
    
    SELECT FROM t1 LEFT JOIN t2 ON t1.a = t2.b LEFT JOIN t3 ON t2.c = t3.d;
    
    We can consider an inner indexscan on t3.d using c = d as indexqual, even
    though t2.c is potentially nulled by a previous outer join.  The comparable
    logic in orindxpath.c has always worked that way, but I was being overly
    cautious here.