Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-patches by date

Next:From: Simon RiggsDate: 2008-09-02 17:13:40
Subject: Re: WIP Join Removal
Previous:From: Tom LaneDate: 2008-09-02 16:28:10
Subject: Re: WIP Join Removal

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group