Re: Any way to Convince postgres to push join clause inside subquery aggregate?

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: Any way to Convince postgres to push join clause inside subquery aggregate?
Дата
Msg-id 87ptijdqxm.fsf@stark.dyndns.tv
обсуждение исходный текст
Ответ на Re: Any way to Convince postgres to push join clause inside subquery aggregate?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Tom Lane <tgl@sss.pgh.pa.us> writes:

> Greg Stark <gsstark@mit.edu> writes:
> > slo=> explain
> > select *
> >  from (select foo_id,count(*) as n from foo_bar group by foo_id) as x
> >  join (select * from foo limit 1) as foo using (foo_id)
> > ;
>
> Why not put the subselect in the output list, if that's the kind of plan
> you want?

Actually that's the way the query is right now. The problem arises because I
want to add a second column without duplicating the whole thing.

--
greg

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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Table name lengths...
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Table name lengths...