Skip site navigation (1) Skip section navigation (2)

Re: Improving count(*)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Improving count(*)
Date: 2005-11-18 00:17:15
Message-ID: 25519.1132273035@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Simon Riggs <simon(at)2ndquadrant(dot)com> writes:
> From here, another proposal. We have a GUC called count_uses_estimate
> that is set to off by default. If set to true, then a count(*) will use
> the planner logic to estimate number of rows in the table and return
> that as the answer, rather than actually count the row.

Ugh.  Why not just provide a function to retrieve the planner estimate,
but *not* call it count(*)?  It would fit nicely with the contrib/dbsize
stuff (or I should say, the stuff formerly in dbsize...)

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Dann CorbitDate: 2005-11-18 00:34:02
Subject: Re: Improving count(*)
Previous:From: Tom LaneDate: 2005-11-18 00:10:00
Subject: Re: Some array semantics issues

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group