Re: Optimising queries involving unions - Mailing list pgsql-performance

From Tom Lane
Subject Re: Optimising queries involving unions
Date
Msg-id 3883.1117130556@sss.pgh.pa.us
Whole thread Raw
In response to Re: Optimising queries involving unions  (Sam Mason <sam@samason.me.uk>)
List pgsql-performance
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

pgsql-performance by date:

Previous
From: "Brad Might"
Date:
Subject: Specific query performance problem help requested - postgresql 7.4
Next
From: Tom Lane
Date:
Subject: Re: Specific query performance problem help requested - postgresql 7.4