Re: getting count for a specific querry

Поиск
Список
Период
Сортировка
От 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 по дате отправления:

Предыдущее
От: "Joel Fradkin"
Дата:
Сообщение: Re: getting count for a specific querry
Следующее
От: PFC
Дата:
Сообщение: Re: getting count for a specific querry