When a relation has been proven empty by constraint exclusion, propagate that
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 24 Mar 2008 21:53:04 +0000 (21:53 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 24 Mar 2008 21:53:04 +0000 (21:53 +0000)
commitfd791e7b5a1bf53131ad15e68e4d4f8ca795fcb4
tree4fbde4ad7311749be170edf100dac55fa464c7f3
parent2a346725bafbc6c7a5dd1771c6004703545a935c
When a relation has been proven empty by constraint exclusion, propagate that
knowledge up through any joins it participates in.  We were doing that already
in some special cases but not in the general case.  Also, defend against zero
row estimates for the input relations in cost_mergejoin --- this fix may have
eliminated the only scenario in which that can happen, but be safe.  Per
report from Alex Solovey.
src/backend/optimizer/path/allpaths.c
src/backend/optimizer/path/costsize.c
src/backend/optimizer/path/joinpath.c
src/backend/optimizer/path/joinrels.c
src/include/nodes/relation.h