pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Chris <dmagick@gmail.com>
To: Christian Paul Cosinas <cpc@cybees.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Speed Up Offset and Limit Clause
Date: Thu, 11 May 2006 16:51:36 +1000
Message-ID: <4462DEF8.7060805@gmail.com> (raw)
In-Reply-To: <002801c67509$8f1a51a0$1e21100a@ghwk02002147>
References: <002801c67509$8f1a51a0$1e21100a@ghwk02002147>

Christian Paul Cosinas wrote:
> Hi!
> 
> How can I speed up my server's performance when I use offset and limit
> clause.
> 
> For example I have a query:
> SELECT * FROM table ORDER BY id, name OFFSET 100000 LIMIT 10000
> 
> This query takes a long time about more than 2 minutes.
> 
> If my query is:
> SELECT * FROM table ORDER BY id, name OFFSET 50000 LIMIT 10000
> It takes about 2 seconds.

Please create a new thread rather than replying to someone elses post 
and changing the subject. These threads can sometimes get missed.

You do have an index on id and name don't you?

-- 
Postgresql & php tutorials
http://www.designmagick.com/



view thread (8+ messages)  latest in thread

Message-ID: <4462DEF8.7060805@gmail.com>
Permalink:  ../4462DEF8.7060805@gmail.com/
Also on:    postgresql.org/message-id/4462DEF8.7060805@gmail.com

 · 

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-performance@postgresql.org
  Cc: dmagick@gmail.com, cpc@cybees.com
  Subject: Re: Speed Up Offset and Limit Clause
  In-Reply-To: <4462DEF8.7060805@gmail.com>

* 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