Re: get_loop_count() fails to ignore RELOPT_DEADREL rels

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: get_loop_count() fails to ignore RELOPT_DEADREL rels
Date: 2014-07-27 16:31:30
Message-ID: 24639.1406478690@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

David Rowley <dgrowleyml(at)gmail(dot)com> writes:
> On Sun, Jul 27, 2014 at 2:35 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-07-27 16:35:49 Re: 9.4 pg_control corruption
Previous Message Tom Lane 2014-07-27 15:28:12 Re: building pdfs