would it be a lot of work, to add optimizations accross unions ? - Mailing list pgsql-hackers

From Grzegorz Jaskiewicz
Subject would it be a lot of work, to add optimizations accross unions ?
Date
Msg-id 30B877B6-63D3-4B49-9337-3AA469A78D42@pointblue.com.pl
Whole thread Raw
Responses Re: would it be a lot of work, to add optimizations accross unions ?
List 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).





pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: add_path optimization
Next
From: James Pye
Date:
Subject: Re: xpath processing brain dead