From: | Roberto Mello <rmello(at)cc(dot)usu(dot)edu> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: how many rows? [was Re: fetching rows]] |
Date: | 2000-11-18 00:11:03 |
Message-ID: | 3A15C917.E3252F9@cc.usu.edu |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
"Robert B. Easter" wrote:
> If someone has done it a better way, I'd like to hear how. However,
> sometimes it is possible to cache a count(*) value somewhere in the database
> so it doesn't have to be found everytime - it depends on your database and
> what the select is if you can store the count in advance somehow.
I don't know how it was implemented (source code is available), but the
PostgreSQL driver for AOLserver (a kick-butt web server for
database-backed websites) has a function that does that. All I do after
a SQL statement is:
set rowcount [ns_pg ntuples]
in my Tcl code and there it is. The driver is available at either
http://www.aolserver.com or http://www.openacs.org (the latter has a
more elaborate version of the driver).
-Roberto
--
Computer Science Utah State University
Space Dynamics Laboratory Web Developer
USU Free Software & GNU/Linux Club http://fslc.usu.edu
My home page - http://www.brasileiro.net/roberto
From | Date | Subject | |
---|---|---|---|
Next Message | Jonathan Ellis | 2000-11-18 00:39:29 | Re: [SQL] Requests for Development |
Previous Message | Robert B. Easter | 2000-11-18 00:03:57 | Re: how many rows? [was Re: fetching rows] |