"Aaron Bono" <postgresql@aranya.com> writes:
> I haven't stared at your query as long as you have so I may have missed
> something
Likewise I'm perhaps speaking too quickly, but at the risk of making a fool of
myself: you should perhaps realize that UNION has to do a fair amount of work
to eliminate duplicates. If you know the rows are going to be distinct or if
you don't care about duplicates you can save a lot of time by using UNION ALL
instead.
--
greg