| От | Robert Treat |
|---|---|
| Тема | Re: COUNT & Pagination |
| Дата | |
| Msg-id | 1073943732.29178.153.camel@camel обсуждение исходный текст |
| Ответ на | Re: COUNT & Pagination (David Shadovitz <david@shadovitz.com>) |
| Список | pgsql-performance |
On Mon, 2004-01-12 at 10:37, David Shadovitz wrote:
> > 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?
>
> PHP.
> But I have only a subset of the results, retrieved via a query with a "LIMIT
> <m>" clause, so $pg_numrows is m.
> And retrieving all results (i.e. no LIMIT) is at least as expensive as
> COUNT(*).
>
Depending on frequency of updates and need for real time info, you could
cache the count in session as long as the user stays within the given
piece of your app.
Robert Treat
--
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера