Re: Overhead of union versus union all

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: Overhead of union versus union all
Дата
Msg-id 1247232164.11347.568.camel@ebony.2ndQuadrant
обсуждение исходный текст
Ответ на Re: Overhead of union versus union all  (Bruce Momjian <bruce@momjian.us>)
Ответы Re: Overhead of union versus union all
Re: Overhead of union versus union all
Список pgsql-general
On Fri, 2009-07-10 at 08:59 -0400, Bruce Momjian wrote:

> > I think it should be possible to use predtest theorem proving to
> discard
> > the sort/hash step in cases where we can prove the sets are
> disjoint.
> > Often there are top-level quals that can be compared in the WHERE
> > clauses of the sub-queries, so a shallow search could be quite
> > profitable in allowing us to rewrite a UNION into a UNION ALL.
>
> I assume we would still need the distinct removal step;  we just avoid
> the sort/hash.

I mean it seems possible to prove that the distinct removal step is not
necessary, by proving that the various sub-queries are already disjoint.
It's a common manual optimization, so automating it seems a reasonable
future goal.

--
 Simon Riggs           www.2ndQuadrant.com
 PostgreSQL Training, Services and Support


В списке pgsql-general по дате отправления:

Предыдущее
От: Jasen Betts
Дата:
Сообщение: Re: PostgreSQL and Poker
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Overhead of union versus union all