From: David Shadovitz <david@www.shadovitz.com>
To: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Cc: mallah@trade-india.com
Subject: Re: COUNT & Pagination
Date: Tue, 13 Jan 2004 10:45:33 -0700
Message-ID: <20040113174533.M77388@www.shadovitz.com> (raw)
In-Reply-To: <1157.192.168.0.100.1074015097.squirrel@system67.trade-india-local.com>
References: <01C3D82B.388A7FE0.david@shadovitz.com>
<1157.192.168.0.100.1074015097.squirrel@system67.trade-india-local.com>
> We avert the subsequent execution of count(*) by passing the
> value of count(*) as a query parameter through the link in page
> numbers.
Mallah, and others who mentioned caching the record count:
Yes, I will certainly do this. I can detect whether the query's filter has
been changed, or whether the user is merely paging through the results or
sorting* the results.
I'd love to completely eliminate the cost of the COUNT(*) query, but I guess
that I cannot have everything.
* My HTML table column headers are hyperlinks which re-execute the query,
sorting the results by the selected column. The first click does an ASC
sort; a second click does a DESC sort.
Thanks.
-David
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: david@www.shadovitz.com, mallah@trade-india.com
Subject: Re: COUNT & Pagination
In-Reply-To: <20040113174533.M77388@www.shadovitz.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