would it be a lot of work, to add optimizations accross unions ?

From: Grzegorz Jaskiewicz <gj(at)pointblue(dot)com(dot)pl>
To: PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: would it be a lot of work, to add optimizations accross unions ?
Date: 2009-02-28 10:44:32
Message-ID: 30B877B6-63D3-4B49-9337-3AA469A78D42@pointblue.com.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Say I have:

select foo (
select foo from bar1
union all
select foo from bar2
union all
select foo from bar3
...
) a order by foo desc limit X;

(and I can give you few other examples around the same 'note', say
with when foo=N in outer subselect)

Would anyone consider such optimization, when postgres will apply the
same condition to inner queries, providing that their size is
substantial?

Same would actually apply for different subqueries, without union/
intersect/etc:

select foo( select foo from bar1 ) a where foo in (x,y,z) order by foo
desc limit N

(of course this is just a simplified example).

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message James Pye 2009-02-28 10:51:27 Re: xpath processing brain dead
Previous Message Tom Lane 2009-02-28 04:06:11 Re: add_path optimization