Re: Quota query with decent performance?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Quota query with decent performance?
Дата
Msg-id 5855.1068614278@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Quota query with decent performance?  (Josh Berkus <josh@agliodbs.com>)
Список pgsql-sql
Josh Berkus <josh@agliodbs.com> writes:
> Second, the query you post is one "SQL Standard" way, which is good for 
> portability but not for speed.  Frankly, I'm not convinced that it's even the
> best SQL standard way.  On the other databases, you seem happy to use 
> non-SQL-standard syntax, so let me give you one such solution in PostgreSQL:
> [snip]

I don't know of any very good solution in bog-standard SQL either.

Aside from the LIMIT-based solution that Josh offered, I recall that
Oleg Bartunov and Teodor Sigaev had some ideas about top-N-aggregate
solutions.  We didn't accept those into the main distribution (yet)
but if you dig in the PG list archives I think there is working code
available.  Try searching for "partial sorting".
        regards, tom lane


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

Предыдущее
От: Chester Kustarz
Дата:
Сообщение: Re: Quota query with decent performance?
Следующее
От: Troels Arvin
Дата:
Сообщение: Re: Quota query with decent performance?