Re: WIP Join Removal - Mailing list pgsql-patches

From Tom Lane
Subject Re: WIP Join Removal
Date
Msg-id 15301.1220373321@sss.pgh.pa.us
Whole thread Raw
In response to WIP Join Removal  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-patches
Simon Riggs <simon@2ndQuadrant.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

pgsql-patches by date:

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