pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jim C. Nasby <jnasby@pervasive.com>
To: Craig A. James <cjames@modgraph-usa.com>
Cc: Christian Paul Cosinas <cpc@cybees.com>
Cc: PFC <lists@peufeu.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Speed Up Offset and Limit Clause
Date: Wed, 17 May 2006 14:04:01 -0500
Message-ID: <20060517190400.GV26212@pervasive.com> (raw)
In-Reply-To: <446A885C.2050308@modgraph-usa.com>
References: <00e101c67997$6aa049f0$1e21100a@ghwk02002147>
	<446A885C.2050308@modgraph-usa.com>

On Tue, May 16, 2006 at 07:20:12PM -0700, Craig A. James wrote:
> >Why I want to use offset and limit is for me to create a threaded
> >application so that they will not get the same results.
> 
> In order to return rows 10000 to 15000, it must select all rows from zero 
> to 15000 and then discard the first 10000 -- probably not what you were 
> hoping for.
> 
> You might add a "thread" column.  Say you want to run ten threads:

Another possibility is partitioning the table. If you do that using
inheritance-based partitioning, you could just select directly from
different partition tables, which probably be even faster than using a
single table. The downside is it's more work to setup.
-- 
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461



view thread (8+ messages)  latest in thread

Message-ID: <20060517190400.GV26212@pervasive.com>
Permalink:  ../20060517190400.GV26212@pervasive.com/
Also on:    postgresql.org/message-id/20060517190400.GV26212@pervasive.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: jnasby@pervasive.com, cjames@modgraph-usa.com, cpc@cybees.com, lists@peufeu.com
  Subject: Re: Speed Up Offset and Limit Clause
  In-Reply-To: <20060517190400.GV26212@pervasive.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