Re: sub-select with aggregate

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: sub-select with aggregate
Дата
Msg-id 20021023085544.S5843-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на Re: sub-select with aggregate  ("Tomasz Myrta" <jasiek@klaster.net>)
Список pgsql-sql
On Wed, 23 Oct 2002, Tomasz Myrta wrote:

> > On Wed, 23 Oct 2002, Tomasz Myrta wrote:
> >
> > > Uz.ytkownik Stephan Szabo napisa?:
> > Without group_id in the select list you couldn't do a where
> > group_id = <something> if the select was a view.
> I know - it was just example of query.
>
> > Did you see the other two queries I gave?  On 7.3, both of those queries
> > appear (according to explain output) to do the limiting of group_id
> > inside the subquery rather than doing the subquery with all rows.
> > The explanation above was why I believe it was different from your
> > original query.
> I saw them. So should I wait for 7.3? Currently I have 7.2 and my work
> stopped because of this.

IIRC 7.2's explain doesn't show which clauses are on which plans (it'll
show that it's doing an index scan or whatever, but not what it's actually
looking for.  The query probably optimizes similarly though.  I'd suggest
trying it and seeing if it runs any better.  I'm also assuming you have
an index on group_id to prevent the sequential scan of users.




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

Предыдущее
От: "Tomasz Myrta"
Дата:
Сообщение: Re: sub-select with aggregate
Следующее
От: "Josh Berkus"
Дата:
Сообщение: Re: Multiple Databases