From: Mark Kirkwood <markir@paradise.net.nz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: mark@mark.mielke.cc, Alessandro Baretta <a.baretta@barettadeit.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Suspending SELECTs
Date: Wed, 18 Jan 2006 18:51:58 +1300
Message-ID: <43CDD77E.7080902@paradise.net.nz> (raw)
In-Reply-To: <4245.1137556941@sss.pgh.pa.us>
References: <43CB71AC.20203@barettadeit.com>
<9766.1137433907@sss.pgh.pa.us>
<43CD4BD0.9090807@barettadeit.com>
<20060117211259.GA13926@mark.mielke.cc>
<43CD8B45.4090907@paradise.net.nz>
<4245.1137556941@sss.pgh.pa.us>
Tom Lane wrote:
> 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.
Right, I think it was actually an Oracle 7.3 based web app (err...
showing age here...) that I used this technique on.
Cheers
Mark
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: markir@paradise.net.nz, tgl@sss.pgh.pa.us, a.baretta@barettadeit.com
Subject: Re: Suspending SELECTs
In-Reply-To: <43CDD77E.7080902@paradise.net.nz>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox