pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Sam Mason <sam@samason.me.uk>
Cc: pgsql-performance@postgresql.org
Subject: Re: Optimising queries involving unions
Date: Thu, 26 May 2005 14:02:36 -0400
Message-ID: <3883.1117130556@sss.pgh.pa.us> (raw)
In-Reply-To: <20050526174203.GK15205@colo.samason.me.uk>
References: <20050526152203.GI15205@colo.samason.me.uk>
	<3339.1117126434@sss.pgh.pa.us>
	<20050526174203.GK15205@colo.samason.me.uk>

Sam Mason <sam@samason.me.uk> writes:
> Tom Lane wrote:
>> It'd be nice to fix this someday, but don't hold your breath ...

> Is it even worth me thinking about trying to figure out how to make
> the current code do this sort of thing?

Probably not :-(.  What we need is to integrate UNION (and the other
set-ops) into the normal querytree structure so that the planner can
consider alternative plans within its existing framework.  That requires
some fundamental changes in the Query structure --- in particular, we
have to get rid of the current situation that there is exactly one
targetlist per rangetable.  Decoupling targetlists and rangetables would
have some other benefits too (INSERT ... SELECT would get a lot cleaner)
but it's a wide-ranging change, and I think could only usefully be
tackled by someone who is already pretty familiar with the code.

			regards, tom lane



view thread (5+ messages)  latest in thread

Message-ID: <3883.1117130556@sss.pgh.pa.us>
Permalink:  ../3883.1117130556@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3883.1117130556@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-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, sam@samason.me.uk
  Subject: Re: Optimising queries involving unions
  In-Reply-To: <3883.1117130556@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