From: Ragnar Hafstaư <gnari@simnet.is>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Joel Fradkin <jfradkin@wazagua.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: getting count for a specific querry
Date: Fri, 08 Apr 2005 16:55:49 +0000
Message-ID: <1112979349.7447.42.camel@localhost.localdomain> (raw)
In-Reply-To: <15084.1112977923@sss.pgh.pa.us>
References: <000001c53c3e$f4f5b730$797ba8c0@jfradkin>
<1112977546.7447.39.camel@localhost.localdomain>
<15084.1112977923@sss.pgh.pa.us>
On Fri, 2005-04-08 at 12:32 -0400, Tom Lane wrote:
> Ragnar =?ISO-8859-1?Q?Hafsta=F0?= <gnari@simnet.is> writes:
> > you might reduce the performance loss if your dataset is ordered by
> > a UNIQUE index.
>
> > select * from mytable where somecondition
> > ORDER by uniquecol limit 50;
>
> > and next:
>
> > select * from mytable where somecondition AND uniquecol>?
> > ORDER by uniquecol limit 50 OFFSET 50;
>
> > where the ? is placeholder for last value returned by last query.
>
> Uh, you don't want the OFFSET there do you?
ooops! of course not. the uniquecol>? is meant to REPLACE
the OFFSET.
gnari
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-sql@postgresql.org
Cc: gnari@simnet.is, tgl@sss.pgh.pa.us, jfradkin@wazagua.com
Subject: Re: getting count for a specific querry
In-Reply-To: <1112979349.7447.42.camel@localhost.localdomain>
* 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