Re: get_loop_count() fails to ignore RELOPT_DEADREL rels - Mailing list pgsql-hackers

From Tom Lane
Subject Re: get_loop_count() fails to ignore RELOPT_DEADREL rels
Date
Msg-id 24639.1406478690@sss.pgh.pa.us
Whole thread Raw
In response to Re: get_loop_count() fails to ignore RELOPT_DEADREL rels  (David Rowley <dgrowleyml@gmail.com>)
List pgsql-hackers
David Rowley <dgrowleyml@gmail.com> writes:
> On Sun, Jul 27, 2014 at 2:35 AM, Tom Lane <tgl@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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: building pdfs
Next
From: Tom Lane
Date:
Subject: Re: 9.4 pg_control corruption