Re: [PATCHES] Approximate count(*) - Mailing list pgsql-docs

From Greg Sabino Mullane
Subject Re: [PATCHES] Approximate count(*)
Date
Msg-id 125db1c7753893171b6ef46609035de8@biglumber.com
Whole thread Raw
In response to Re: [PATCHES] Approximate count(*)  (David Fetter <david@fetter.org>)
Responses Re: [PATCHES] Approximate count(*)  (Josh Berkus <josh@agliodbs.com>)
List pgsql-docs
-----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@turnstep.com
PGP Key: 0x14964AC8 200503242126
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

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



pgsql-docs by date:

Previous
From: David Fetter
Date:
Subject: Re: [PATCHES] Approximate count(*)
Next
From: Josh Berkus
Date:
Subject: Re: [PATCHES] Approximate count(*)