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

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: would it be a lot of work, to add optimizations accross unions ?
Дата
Msg-id 87fxhyssfg.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответ на would it be a lot of work, to add optimizations accross unions ?  (Grzegorz Jaskiewicz <gj@pointblue.com.pl>)
Ответы Re: would it be a lot of work, to add optimizations accross unions ?
Список pgsql-hackers
Grzegorz Jaskiewicz <gj@pointblue.com.pl> writes:

> 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?

Well you haven't said what optimization you're looking for here. 

I posted a patch to look for an ordered path for members of a union a while
back but it still needed a fair amount of work before it was usable.

The LIMIT can't be pushed into the union unless we do have ordered paths so
that's further down the line. (And even then it would only work if there are
no conditions on there append path.)

And I believe we already do push down where clauses like foo=N.

> 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

huh?

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com Ask me about EnterpriseDB's RemoteDBA services!


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

Предыдущее
От: James Pye
Дата:
Сообщение: Re: xpath processing brain dead
Следующее
От: Grzegorz Jaskiewicz
Дата:
Сообщение: Re: would it be a lot of work, to add optimizations accross unions ?