Re: Proposed patch for qual pushdown into UNION/INTERSECT

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Proposed patch for qual pushdown into UNION/INTERSECT
Дата
Msg-id 3577.1030634699@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Proposed patch for qual pushdown into UNION/INTERSECT  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список pgsql-patches
Stephan Szabo <sszabo@megazone23.bigpanda.com> writes:
> I do wonder if queries like
> select * from ((select * from bar1 union all select * from bar2
> union all (select * from bar1 except select * from bar2)) intersect select
> * from bar1) as foo where a>4;

> can push the a>4 restriction into the right side of the intersect which it
> doesn't seem to right now,

Not without a lot more work, which I haven't got time for now.

> We could probably do:
> Subquery
>  Intersect
>   Append
>    Subquery (passing down a>4)
>    Subquery (passing down a>4)
>    <something> (filter a>4)
>     Except
>      Subquery
>      Subquery
>   Subquery (passing down a>4)
> and get the same effect,

Yeah, the problem is the planner doesn't currently cope with attaching
quals to intermediate levels of a set-op tree, so there's no way to
do the above.

> but I think
> the mixed case is probably rare enough
> to not worry about for now.

Agreed.  This is still a step forward.

            regards, tom lane

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

Предыдущее
От: Manfred Koizar
Дата:
Сообщение: Re: Visibility regression test
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Visibility regression test