Re: [SQL] OFFSET impact on Performance???

From: "Andrei Bintintan" <klodoma(at)ar-sd(dot)net>
To: "Richard Huxton" <dev(at)archonet(dot)com>
Cc: <pgsql-sql(at)postgresql(dot)org>, <pgsql-performance(at)postgresql(dot)org>
Subject: Re: [SQL] OFFSET impact on Performance???
Date: 2005-01-20 13:45:47
Message-ID: 020d01c4fef6$595bb9d0$0b00a8c0@forge
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance pgsql-sql

> If you're using this to provide "pages" of results, could you use a
> cursor?
What do you mean by that? Cursor?

Yes I'm using this to provide "pages", but If I jump to the last pages it
goes very slow.

Andy.

----- Original Message -----
From: "Richard Huxton" <dev(at)archonet(dot)com>
To: "Andrei Bintintan" <klodoma(at)ar-sd(dot)net>
Cc: <pgsql-sql(at)postgresql(dot)org>; <pgsql-performance(at)postgresql(dot)org>
Sent: Thursday, January 20, 2005 2:10 PM
Subject: Re: [SQL] OFFSET impact on Performance???

> Andrei Bintintan wrote:
>> Hi to all,
>>
>> I have the following 2 examples. Now, regarding on the offset if it
>> is small(10) or big(>50000) what is the impact on the performance of
>> the query?? I noticed that if I return more data's(columns) or if I
>> make more joins then the query runs even slower if the OFFSET is
>> bigger. How can I somehow improve the performance on this?
>
> There's really only one way to do an offset of 1000 and that's to fetch
> 1000 rows and then some and discard the first 1000.
>
> If you're using this to provide "pages" of results, could you use a
> cursor?
>
> --
> Richard Huxton
> Archonet Ltd
>

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Hervé Piedvache 2005-01-20 14:03:31 PostgreSQL clustering VS MySQL clustering
Previous Message Merlin Moncure 2005-01-20 13:20:21 Re: OFFSET impact on Performance???

Browse pgsql-sql by date

  From Date Subject
Next Message Joel Fradkin 2005-01-20 13:56:12 Re: ERROR: row is too big: size 9856, maximum size 8136
Previous Message Richard Huxton 2005-01-20 12:10:59 Re: [SQL] OFFSET impact on Performance???