David Rowley <dgrowle...@gmail.com> writes: > On Sun, Jul 27, 2014 at 2:35 AM, Tom Lane <t...@sss.pgh.pa.us> wrote: >> That patch is entirely bogus. What you should be asking is why >> get_loop_count is being applied to a relation that's supposedly been >> removed from the query.
> hmm ok. After further investigation it seems that this is down to the > EquivalenceClass still containing references to the dead rel. What seems to > be happening is match_eclass_clauses_to_index() is calling > generate_implied_equalities_for_column() which is generating RestrictInfo > clauses which make reference to the dead relation. Hm. Maybe we need to improve the join removal code so that it cleans out the eclasses better? But, as you say, it's not clear why it's not failing for the existing left-join cases if that's the problem. You should probably spend a bit of time to understand exactly how the difference is arising. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers