Re: Patch to support SEMI and ANTI join removal

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Jim Nasby <jim(at)nasby(dot)net>, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch to support SEMI and ANTI join removal
Date: 2014-09-12 09:17:48
Message-ID: CAApHDvrkHo=GiNU4nTQN9j6JJKz+wQ83HB0oFz=W_d0ztXuoDA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Sep 12, 2014 at 3:35 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:

> On Thu, Sep 11, 2014 at 7:14 AM, David Rowley <dgrowleyml(at)gmail(dot)com>
> wrote:
> >
>
> 1. I don't think that I'm currently handling removing eclass members
> > properly. So far the code just removes the Vars that belong to the
> relation
> > being removed. I likely should also be doing
> bms_del_member(ec->ec_relids,
> > relid); on the eclass, but perhaps I should just be marking the whole
> class
> > as "ec_broken = true" and adding another eclass all everything that the
> > broken one has minus the parts from the removed relation?
>
> I haven't read the patch, but I think the question is why this needs
> to be different than what we do for left join removal.
>
>
I discovered over here ->
http://www.postgresql.org/message-id/CAApHDvo5wCRk7uHBuMHJaDpbW-b_oGKQOuisCZzHC25=H3__fA@mail.gmail.com
during the early days of the semi and anti join removal code that the
planner was trying to generate paths to the dead rel. I managed to track
the problem down to eclass members still existing for the dead rel. I guess
we must not have eclass members for outer rels? or we'd likely have seen
some troubles with left join removals already.

In the meantime I'll fix up the inner join removal code to properly delete
the ec_relids member for the dead rel. I guess probably the restrict info
should come out too.

I know it's late in the commitfest, but since there was next to no interest
in semi and anti join removals, can I rename the patch in the commitfest
app to be "Inner join removals"? It's either that or I'd mark that patch as
rejected and submit this one in October.

Regards

David Rowley

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2014-09-12 09:28:47 Re: B-Tree support function number 3 (strxfrm() optimization)
Previous Message Heikki Linnakangas 2014-09-12 09:15:58 Re: Stating the significance of Lehman & Yao in the nbtree README