| От | PFC |
|---|---|
| Тема | Re: getting count for a specific querry |
| Дата | |
| Msg-id | op.soxnphy2th1vuj@localhost обсуждение исходный текст |
| Ответ на | Re: getting count for a specific querry ("Joel Fradkin" <jfradkin@wazagua.com>) |
| Список | pgsql-sql |
> Since it is a count of matched condition records I may not have a way > around. What you could do is cache the search results (just caching the id's of the rows to display is enough and uses little space) in a cache table, numbering them with your sort order using a temporary sequence, so that you can :SELECT ... FROM cache WHERE row_position BETWEEN page_no*per_page AND (page_no+1)*per_page-1to get the count :SELECT row_position FROM CACHE ORDER BY row_position DESC LIMIT 1 Add a session_id referencing your sessions table with an ON DELETE CASCADE and the cache will be auto-purged when sessions expire.
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера