Re: Can this query go faster??? - Mailing list pgsql-performance

From Tino Wildenhain
Subject Re: Can this query go faster???
Date
Msg-id 43958461.2060106@wildenhain.de
Whole thread Raw
In response to Re: Can this query go faster???  (Joost Kraaijeveld <J.Kraaijeveld@Askesis.nl>)
List pgsql-performance
Joost Kraaijeveld schrieb:
> On Tue, 2005-12-06 at 12:36 +0100, Tino Wildenhain wrote:
>
>>>I just tried it: a cursor is not faster (what does not surprise me at
>>>all, as the amount of work looks the same to me)
>>
>>Actually no, if you scroll forward, you just ask the database for the
>>next rows to materialize. So if you are ahead in your database and
>>ask for next rows, it should be faster then working w/ an offset
>>from start each time.
>
> Ah, a misunderstanding: I only need to calculate an index if the user
> wants a record that is not in or adjacent to the cache (in which case I
> can do a "select values > last value in the cache". So  I must always
> materialize all rows below the wanted index.
>
Yes, but still advancing a few blocks from where the cursor is
should be faster then re-issuing the query and scroll thru
the whole resultset to where you want to go.



pgsql-performance by date:

Previous
From: Joost Kraaijeveld
Date:
Subject: Re: Can this query go faster???
Next
From: Jan Wieck
Date:
Subject: Re: Performance degradation after successive UPDATE's