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

From Martijn van Oosterhout
Subject Re: [HACKERS] Much Ado About COUNT(*)
Date
Msg-id 20050114233745.GH1724@svana.org
Whole thread Raw
In response to Re: [HACKERS] Much Ado About COUNT(*)  ("Dann Corbit" <DCorbit@connx.com>)
Responses Re: [HACKERS] Much Ado About COUNT(*)  (Wes <wespvp@syntegra.com>)
List pgsql-general
On Fri, Jan 14, 2005 at 03:11:32PM -0800, Dann Corbit wrote:
> A cardinality estimate function might be nice.
> SELECT cardinality_estimate(table_name)
> If it is off by 25% then no big deal.
> It would be useful for the PostgreSQL query planner also, I imagine.

If that's all you want, what about the row estimate from pg_class? It
has the number of rows active at last vacuum... For really large tables
I imagine it'd be easily close enough...

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment

pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: OID Usage
Next
From: Terry Lee Tucker
Date:
Subject: Re: OID Usage