From: Tino Wildenhain <tino@wildenhain.de>
To: Joost Kraaijeveld <J.Kraaijeveld@Askesis.nl>
Cc: Csaba Nagy <nagy@ecircle-ag.com>
Cc: Pgsql-Performance <pgsql-performance@postgresql.org>
Subject: Re: Can this query go faster???
Date: Tue, 06 Dec 2005 11:32:36 +0100
Message-ID: <439568C4.8050601@wildenhain.de> (raw)
In-Reply-To: <1133864460.8837.69.camel@Panoramix>
References: <1133862229.8837.61.camel@Panoramix>
<1133862777.4779.185.camel@coppola.muc.ecircle.de>
<1133864460.8837.69.camel@Panoramix>
Joost Kraaijeveld schrieb:
> On Tue, 2005-12-06 at 10:52 +0100, Csaba Nagy wrote:
>
>>Joost,
>>
>>Why do you use an offset here ? I guess you're traversing the table
>>somehow, in this case it would be better to remember the last zipcode +
>>housenumber and put an additional condition to get the next bigger than
>>the last one you've got... that would go for the index on
>>zipcode+housenumber and be very fast. The big offset forces postgres to
>>traverse that many entries until it's able to pick the one row for the
>
> I am forced to translate a sorting dependent record number to a record
> in the database. The GUI (a Java JTable) works with record /row numbers,
> which is handy if one has an ISAM database, but not if one uses
> PostgreSQL.
You can have a row number in postgres easily too. For example if you
just include a serial for the row number.
Cursor would work too but you would need to have a persistent connection.
Regards
Tino
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: tino@wildenhain.de, J.Kraaijeveld@Askesis.nl, nagy@ecircle-ag.com
Subject: Re: Can this query go faster???
In-Reply-To: <439568C4.8050601@wildenhain.de>
* 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