Re: WIP Join Removal - Mailing list pgsql-patches

From Simon Riggs
Subject Re: WIP Join Removal
Date
Msg-id 1220375620.4371.479.camel@ebony.2ndQuadrant
Whole thread Raw
In response to Re: WIP Join Removal  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: WIP Join Removal  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
On Tue, 2008-09-02 at 12:28 -0400, Tom Lane wrote:
> Simon Riggs <simon@2ndQuadrant.com> writes:
> > As discussed on 26 June, "Join Removal/Vertical Partitioning", here's a
> > patch to remove joins in certain circumstances.
>
> Some points not made in the thread so far:

Various comments accepted and agreed.

> > +              * XXX Seems not worth searching partial indexes because those
> > +              * are only usable with a appropriate restriction, so the
> > +              * only way they could ever be usable is if there was a
> > +              * restriction that exactly matched the index predicate,
> > +              * which is possible but generally unlikely.
>
> I haven't thought this through entirely, but wouldn't a partial index be
> okay if it's marked predOK?  You might be right that the case is
> unlikely, but if it's only one extra line to support it ...

As of now, its it is predOK then that implies there was a qual on the
checkrel so can't remove the join. So no need to check.

> > +     if (removable &&
> > +         joinrel->cheapest_total_path < keeprel->cheapest_total_path)
>
> This test on cheapest_total_path seems pretty wacko

and stuff below it definitely is, from upthread discussion.

Hang fire on more comments - its a short patch but needs a few thwacks
from the cluestick yet before next review.

--
 Simon Riggs           www.2ndQuadrant.com
 PostgreSQL Training, Services and Support


pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: WIP Join Removal
Next
From: Tom Lane
Date:
Subject: Re: WIP Join Removal