Folks,
Please find enclosed a patch that shows how to get a quick
approximation of count(*) on a table.
Cheers,
D
--
David Fetter [EMAIL PROTECTED] http://fetter.org/
phone: +1 510 893 6100 mobile: +1 415 235 3778
Remember to vote!
Index: doc/src/sgml/func.sgml
===
David Fetter <[EMAIL PROTECTED]> writes:
> Please find enclosed a patch that shows how to get a quick
> approximation of count(*) on a table.
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.
r
On Thu, Mar 24, 2005 at 12:34:51PM -0500, Tom Lane wrote:
> David Fetter <[EMAIL PROTECTED]> writes:
> > Please find enclosed a patch that shows how to get a quick
> > approximation of count(*) on a table.
>
> I'm not sure we should be encouraging people to look at reltuples...
> for one thing, it
-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. :)
David,
If Jim and I finish our work for 8.1, then you'll be able to do:
SELECT approx_records FROM pg_sysviews.pg_tables WHERE schema_name = 'schema'
AND table_name = 'table'
But the same caveats will apply.
--
Josh Berkus
Aglio Database Solutions
San Francisco
---(en