Re: select within aggregate?

Поиск
Список
Период
Сортировка
От Vortex
Тема Re: select within aggregate?
Дата
Msg-id 20050507181230.4044d498.vortex25@gmx.de
обсуждение исходный текст
Ответ на Re: select within aggregate?  (Bruno Wolff III <bruno@wolff.to>)
Список pgsql-sql
On Fri, 6 May 2005 07:49:23 -0500
Bruno Wolff III <bruno@wolff.to> wrote:

> You could use max(ts) as long as you can have two requests occur at the
> same time. This might be a reasonable assumption, but it might have been
> better to include a sequence so that each record would be guaranteed to
> have a unique key.
Yes, of course. So far it was more a theoretical question.

> Using DISTINCT ON to get the latest URIs is probably better. You can
> join that query to the one doing the count. This will probably be more
> efficient than executing a subquery for each remote host.
The DISTINCT ON construction looks quite interesting. It seems to allow
some sorting within an group (even althought it's no real aggregate) in
general. I can't say if it's really more eficient than the solution suggested
by R.Muralidharan. But i will do some tests!

Thank you very much!

Klaus


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

Предыдущее
От: "Tornroth, Phill"
Дата:
Сообщение: Re: multi-column unique constraints with nullable columns
Следующее
От: Aarni Ruuhimäki
Дата:
Сообщение: Re: encoding