pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrei Bintintan <klodoma@ar-sd.net>
To: Richard Huxton <dev@archonet.com>
Cc: pgsql-sql@postgresql.org
Cc: pgsql-performance@postgresql.org
Subject: Re: [SQL] OFFSET impact on Performance???
Date: Thu, 20 Jan 2005 15:45:47 +0200
Message-ID: <020d01c4fef6$595bb9d0$0b00a8c0@forge> (raw)
References: <019f01c4fee1$1b58d600$0b00a8c0@forge>
	<41EF9FD3.5020400@archonet.com>

> 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@archonet.com>
To: "Andrei Bintintan" <klodoma@ar-sd.net>
Cc: <pgsql-sql@postgresql.org>; <pgsql-performance@postgresql.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
> 




view thread (22+ messages)  latest in thread

Message-ID: <020d01c4fef6$595bb9d0$0b00a8c0@forge>
Permalink:  ../020d01c4fef6$595bb9d0$0b00a8c0@forge/
Also on:    postgresql.org/message-id/020d01c4fef6$595bb9d0$0b00a8c0@forge

 · 

reply

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: klodoma@ar-sd.net, dev@archonet.com, pgsql-performance@postgresql.org
  Subject: Re: [SQL] OFFSET impact on Performance???
  In-Reply-To: <020d01c4fef6$595bb9d0$0b00a8c0@forge>

* 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