Re: Much Ado About COUNT(*)

From: "Jim C(dot) Nasby" <decibel(at)decibel(dot)org>
To: Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Much Ado About COUNT(*)
Date: 2005-01-23 21:36:18
Message-ID: 20050123213618.GY67721@decibel.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-announce pgsql-hackers pgsql-patches

On Sun, Jan 23, 2005 at 12:36:10AM -0800, Ron Mayer wrote:
> Bruce Momjian wrote:
> >Added to TODO based on this discusion:...
> >* Speed up COUNT(*)
>
> One think I think would help lots of people is if the
> documentation near the COUNT aggregate explained some
> of the techniques using triggers to maintain a count
> for tables where this is important.
>
> For every one person who reads the mailinglist archives,
> I bet there are dozens who merely read the product
> documentation and never find the workaround/solution.
>
> Perhaps a note below the table here:
> http://www.postgresql.org/docs/8.0/interactive/functions-aggregate.html#FUNCTIONS-AGGREGATE-TABLE
> would be a good place. If it is already somewhere in
> the docs; perhaps the page I linked should refer to the
> other page as well.

Does anyone have working code they could contribute? It would be best to
give at least an example in the docs. Even better would be something in
pgfoundry that helps build a summary table and the rules/triggers you
need to maintain it.
--
Jim C. Nasby, Database Consultant decibel(at)decibel(dot)org
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"

In response to

Responses

Browse pgsql-announce by date

  From Date Subject
Next Message Mark Kirkwood 2005-01-23 23:41:55 Re: Much Ado About COUNT(*)
Previous Message Ron Mayer 2005-01-23 08:36:10 Re: Much Ado About COUNT(*)

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim C. Nasby 2005-01-23 21:42:48 Re: [pgsql-hackers] Re: Extending System Views: proposal for 8.1/8.2
Previous Message Jim C. Nasby 2005-01-23 21:34:23 Re: Extending System Views: proposal for 8.1/8.2

Browse pgsql-patches by date

  From Date Subject
Next Message Stephen Frost 2005-01-23 22:05:28 Re: [PATCHES] Merge pg_shadow && pg_group -- UNTESTED
Previous Message Alvaro Herrera 2005-01-23 21:15:49 Re: [PATCHES] Merge pg_shadow && pg_group -- UNTESTED