Re: Bug in planner

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: Teodor Sigaev <teodor(at)sigaev(dot)ru>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bug in planner
Date: 2015-04-25 20:18:25
Message-ID: 3993.1429993105@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 24 April 2015 at 21:43, Teodor Sigaev <teodor(at)sigaev(dot)ru> wrote:
>> I faced with planner error:
>> ERROR: could not find RelOptInfo for given relids

> I've done a little debugging on this too and I get the idea that in
> eqjoinsel() that min_righthand incorrectly does not have a bit set for "t3"

Yeah. The short of it seems to be that initsplan.c is too optimistic
about whether antijoins can be reordered against outer joins in their RHS.
The discussion in optimizer/README says pretty clearly that they can't
(and eqjoinsel is relying on that, per the comment therein), so I think
this is basically brain fade in translating that logic to code.

regards, tom lane

Attachment Content-Type Size
antijoin-fix.patch text/x-diff 4.5 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2015-04-25 20:23:21 Re: PL/pgSQL, RAISE and error context
Previous Message Peter Geoghegan 2015-04-25 20:00:02 Re: INSERT ... ON CONFLICT syntax issues