Re: [HACKERS] Much Ado About COUNT(*) - Mailing list pgsql-general

From David Garamond
Subject Re: [HACKERS] Much Ado About COUNT(*)
Date
Msg-id 41E65CC6.8050901@zara.6.isreserved.com
Whole thread Raw
Responses Re: [HACKERS] Much Ado About COUNT(*)
List pgsql-general
Merlin Moncure wrote:
> 6.  for large tables, you can get a pretty accurate count by doing:
> select count(*) * 10 from t where random() > .9;
> on my setup, this shaved about 15% off of the counting time...YMMV.

That's an interesting idea, using sampling to get an estimate.

Thanks for the tip.

--
dave

pgsql-general by date:

Previous
From: sid tow
Date:
Subject: problem with the select query
Next
From: Együd Csaba
Date:
Subject: pgsqlODBC problems