Re: Postgresql.conf

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Jeremy Haile <jhaile(at)fastmail(dot)fm>
Cc: Brandon Aiken <BAiken(at)winemantech(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Postgresql.conf
Date: 2007-01-23 20:18:18
Message-ID: 20070123201818.GA29642@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jan 23, 2007 at 14:15:23 -0500,
Jeremy Haile <jhaile(at)fastmail(dot)fm> wrote:
> But there are ways that we could optimize count(*) queries for specific
> circumstances right? Obviously this isn't trivial, but I think it would
> be nice if we could maintain a number of rows count that could be used
> when performing a count(*) on the whole table (no where clause).

People can already do that. How to do it right (to avoid update contention)
is even described in the mailing list archives. There just isn't a nice
contrib or pgfoundry project to wrap it up for them. Of course if there was
people might install the project even though there was a net loss in
performance for them.

> I don't know if the overhead of keeping track of that number is worth
> the benefits - but I know that querying for the number of rows in a
> table is a common need and other RDBMSs do optimize for that special
> case.

That is debatable. Certainly a lot of people run adhoc unconstrained count(*)
queries. Whether they normally need exact counts or whether the number of such
queries is large enough compared to other queries being done to be considered
common is another matter.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Fernando De Pedro 2007-01-23 20:35:16 dump desde dentro de una base
Previous Message marcelo Cortez 2007-01-23 20:12:50 how to read bytea field