pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Michael Landin Hostbaek <mich@freebsdcluster.org>
Cc: PostgresSQL list <pgsql-sql@postgresql.org>
Subject: Re: Double query (limit and offset)
Date: Wed, 19 Oct 2005 08:25:49 +0100
Message-ID: <4355F4FD.5080006@archonet.com> (raw)
In-Reply-To: <20051011151105.GA29943@mich2.itxmarket.com>
References: <20051011151105.GA29943@mich2.itxmarket.com>

Michael Landin Hostbaek wrote:
> List, 
> 
> I'm using the OFFSET / LIMIT combo in order to split up my query, so it
> only parses 20 rows at a time (for my php-scripted webpage).

The best way to do it is to have a layer between your application and 
the database that can cache the results of your query. Unfortunately PHP 
is not ideal for this - you might want to google for "php memcache" and 
"pgmemcache" though.

Once you can cache the query, you run it once, use the row-count and 
then fetch the rows from cache.
--
   Richard Huxton
   Archonet Ltd



view thread (3+ messages)  latest in thread

Message-ID: <4355F4FD.5080006@archonet.com>
Permalink:  ../4355F4FD.5080006@archonet.com/
Also on:    postgresql.org/message-id/4355F4FD.5080006@archonet.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-sql@postgresql.org
  Cc: dev@archonet.com, mich@freebsdcluster.org
  Subject: Re: Double query (limit and offset)
  In-Reply-To: <4355F4FD.5080006@archonet.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