Geo Carncross wrote:
> On Thu, 2005-12-15 at 17:35 +0100, Thomas Mueller wrote:
> > Geo Carncross wrote:
> > 
> > > I completely agree with this. There's just the problem of databases
> > > being a moving target. Remember we talked about COUNT(*) not being
> > > optimally implemented in Pg, but one day it could be, and at that point,
> > > we should use COUNT(*) - even if it's slower on older database versions.
> > 
> > That day is in the past :-) 8.1 release notes:
> > 
> > Faster Aggregates: aggregate functions have been improved to make
> > reporting queries even faster. The PostgreSQL developers both rewritten
> > memory management for aggregates and added indexing optimizations for
> > MIN() and MAX().
> 
> Woot!
> 
> I mean, does it apply specifically to COUNT(*)? I checked the release
> notes and I couldn't find mention of it...

If you're looking to find the total size of a table, no.  In
PostgreSQL, that's a Fundamentally Hard Problem because of MVCC.

It will make use of indexes in the WHERE clause, of course, to limit
the rows it has to visit.  I think that's always been the case.


-- 
Kevin Brown                                           [EMAIL PROTECTED]

Reply via email to