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: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Cc: List pgsql-patches <pgsql-patches@postgresql.org>
Subject: Re: WIP Join Removal
Date: Tue, 02 Sep 2008 12:02:05 -0400
Message-ID: <14800.1220371325@sss.pgh.pa.us> (raw)
In-Reply-To: <1220352898.4371.355.camel@ebony.2ndQuadrant>
References: <1220176372.4371.118.camel@ebony.2ndQuadrant>
	<48BC4127.30706@enterprisedb.com>
	<1220348487.4371.307.camel@ebony.2ndQuadrant>
	<48BD1374.4030504@enterprisedb.com>
	<1220352112.4371.349.camel@ebony.2ndQuadrant>
	<48BD1852.1070904@enterprisedb.com>
	<1220352898.4371.355.camel@ebony.2ndQuadrant>

Simon Riggs <simon@2ndQuadrant.com> writes:
>> Oh. How does the query look like after removing the join, then?

> Same answer, just slower. Removing the join makes the access to a into a
> SeqScan, whereas it was a two-table index plan when both tables present.

I don't really believe this: please show an actual case where the join
would be faster.

AFAICS, in the outer-join examples, it is not possible for a join to
enable some kind of indexscan on the outer table, because by definition
an outer join excludes none of the left-hand rows.  So a seqscan on the
outer is optimal.

I also find all the worry about generating other plans for the inner
relation to be off the mark.  You're not going to *use* any plan for the
inner rel, so who cares what plans it has?

			regards, tom lane



view thread (26+ messages)  latest in thread

Message-ID: <14800.1220371325@sss.pgh.pa.us>
Permalink:  ../14800.1220371325@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/14800.1220371325@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, heikki.linnakangas@enterprisedb.com
  Subject: Re: WIP Join Removal
  In-Reply-To: <14800.1220371325@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