pg.ddx.io  pgsql-patches@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Simon Riggs <simon@2ndQuadrant.com>
Cc: List pgsql-patches <pgsql-patches@postgresql.org>
Subject: Re: WIP Join Removal
Date: Tue, 02 Sep 2008 12:35:21 -0400
Message-ID: <15301.1220373321@sss.pgh.pa.us> (raw)
In-Reply-To: <1220176372.4371.118.camel@ebony.2ndQuadrant>
References: <1220176372.4371.118.camel@ebony.2ndQuadrant>

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



view thread (26+ messages)  latest in thread

Message-ID: <15301.1220373321@sss.pgh.pa.us>
Permalink:  ../15301.1220373321@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/15301.1220373321@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-patches@postgresql.org
  Cc: tgl@sss.pgh.pa.us, simon@2ndQuadrant.com
  Subject: Re: WIP Join Removal
  In-Reply-To: <15301.1220373321@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox