Re: Paged Query

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: Paged Query
Дата
Msg-id 4FFAC85E.4010607@ringerc.id.au
обсуждение исходный текст
Ответ на Re: Paged Query  (Gregg Jaskiewicz <gryzman@gmail.com>)
Ответы Re: Paged Query
Список pgsql-performance
On 07/09/2012 07:55 PM, Gregg Jaskiewicz wrote:
> Use cursors.
> By far the most flexible. offset/limit have their down sides.
Do do cursors.

Keeping a cursor open across user think time has resource costs on the
database. It doesn't necessarily require keeping the transaction open
(with hold cursors) but it's going to either require a snapshot to be
retained or the whole query to be executed by the DB and stored somewhere.

Then the user goes away on a week's holiday and leaves their PC at your
"next" button.

All in all, limit/offset have better bounded and defined costs, albeit
not very nice ones.

--
Craig Ringer


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