Re: [PATCHES] Approximate count(*)

From: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>
To: pgsql-docs(at)postgresql(dot)org
Subject: Re: [PATCHES] Approximate count(*)
Date: 2005-03-25 02:34:14
Message-ID: 125db1c7753893171b6ef46609035de8@biglumber.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-patches


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


David Fetter wrote:
> Please find enclosed a patch that shows how to get a quick
> approximation of count(*) on a table.

You should mention that ANALYZE will also populate reltuples.

To be real anal, you should say pg_catalog.pg_class too. :)

Tom Lane asked:
>> I'm not sure we should be encouraging people to look at reltuples...
>> for one thing, it's deliberately a moving average under 8.0.

> Should there be more caveats?

Well, it already says "approximate", the value-laden word is "good".
Perhaps if that went away...

- --
Greg Sabino Mullane greg(at)turnstep(dot)com
PGP Key: 0x14964AC8 200503242126
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iD8DBQFCQ3iivJuQZxSWSsgRAm+PAKCNJPUl7Xns0kLKvbDjOiuNN2g4agCfbmg+
hX8RHO4R2Ad2fQyCPl+Ha3I=
=2Gal
-----END PGP SIGNATURE-----

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Josh Berkus 2005-03-25 03:19:00 Re: [PATCHES] Approximate count(*)
Previous Message David Fetter 2005-03-24 17:58:27 Re: [PATCHES] Approximate count(*)

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2005-03-25 02:57:54 Re: Makefile breakage
Previous Message Bruce Momjian 2005-03-25 01:01:39 Re: pgsql: Add URL of how to report bugs: