Re: Double query (limit and offset) - Mailing list pgsql-sql

From Richard Huxton
Subject Re: Double query (limit and offset)
Date
Msg-id 4355F4FD.5080006@archonet.com
Whole thread Raw
In response to Double query (limit and offset)  (Michael Landin Hostbaek <mich@freebsdcluster.org>)
List pgsql-sql
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


pgsql-sql by date:

Previous
From: Janning Vygen
Date:
Subject: Re: Double query (limit and offset)
Next
From: Oliver Elphick
Date:
Subject: Re: Query information needed