Re: WIP Join Removal

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: List pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: WIP Join Removal
Date: 2008-09-02 16:35:21
Message-ID: 15301.1220373321@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Simon Riggs <simon(at)2ndQuadrant(dot)com> writes:
> + if (removable &&
> + joinrel->cheapest_total_path < keeprel->cheapest_total_path)
> + {
> + elog(LOG, "join removed");
> + joinrel->pathlist = keeprel->pathlist;
> + joinrel->joininfo = keeprel->baserestrictinfo;
> + }
> + }

On third thought: if you think that the join paths could possibly win,
then the correct coding here is something like

foreach(path, keeprel->pathlist)
add_path(joinrel, ...)

The reason is that it's not an all-or-nothing choice: some of the paths
might offer cheaper startup cost, or present a useful sort order.
So just present them as available alternatives and let add_path sort it
out.

regards, tom lane

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Simon Riggs 2008-09-02 17:13:40 Re: WIP Join Removal
Previous Message Tom Lane 2008-09-02 16:28:10 Re: WIP Join Removal