Re: Double query (limit and offset)

From: Richard Huxton <dev(at)archonet(dot)com>
To: Michael Landin Hostbaek <mich(at)freebsdcluster(dot)org>
Cc: PostgresSQL list <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Double query (limit and offset)
Date: 2005-10-19 07:25:49
Message-ID: 4355F4FD.5080006@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Janning Vygen 2005-10-19 07:34:22 Re: Double query (limit and offset)
Previous Message Chris Travers 2005-10-19 06:03:05 Re: Problem -Postgre sql