Re: Suspending SELECTs

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Suspending SELECTs
Дата
Msg-id 4245.1137556941@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Suspending SELECTs  (Mark Kirkwood <markir@paradise.net.nz>)
Ответы Re: Suspending SELECTs  (Mark Kirkwood <markir@paradise.net.nz>)
Список pgsql-performance
Mark Kirkwood <markir@paradise.net.nz> writes:
> SELECT ... FROM table WHERE ... ORDER BY id LIMIT 20;

> Suppose this displays records for id 10000 -> 10020.
> When the user hits next, and page saves id=10020 in the session state
> and executes:

> SELECT ... FROM table WHERE ... AND id > 10020 ORDER BY id LIMIT 20;

> Clearly you have to be a little careful about whether to use '>' or '>='
> depending on whether 'id' is unique or not (to continue using '>' in the
> non unique case, you can just save and use all the members of the
> primary key too).

This is actually fairly painful to get right for a multi-column key
at the moment.  It'll be much easier once I finish up the
SQL-spec-row-comparison project.  See this thread for background:
http://archives.postgresql.org/pgsql-performance/2004-07/msg00188.php

            regards, tom lane

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

Предыдущее
От: "Craig A. James"
Дата:
Сообщение: Re: Suspending SELECTs
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Getting pg to use index on an inherited table (8.1.1)