Re: COUNT & Pagination

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: COUNT & Pagination
Дата
Msg-id 200401121016.37918.dev@archonet.com
обсуждение исходный текст
Ответ на COUNT & Pagination  (David Shadovitz <david@shadovitz.com>)
Список pgsql-performance
On Sunday 11 January 2004 18:10, David Shadovitz wrote:
> I understand that COUNT queries are expensive.  So I'm looking for advice
> on displaying paginated query results.
>
> I display my query results like this:
>
>   Displaying 1 to 50 of 2905.
>   1-50 | 51-100 | 101-150 | etc.
>
> I do this by executing two queries.

If you only need the count when you've got the results, most PG client
interfaces will tell you how many rows you've got. What language is your app
in?

--
  Richard Huxton
  Archonet Ltd

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: annoying query/planner choice
Следующее
От: Andrew Rawnsley
Дата:
Сообщение: Re: annoying query/planner choice