Re: fast count(*) through statistics collector - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: fast count(*) through statistics collector
Date
Msg-id 1205922132.4285.369.camel@ebony.site
Whole thread Raw
In response to fast count(*) through statistics collector  (Artem Yazkov <markkrass@kemcity.ru>)
List pgsql-hackers
On Tue, 2008-03-18 at 21:26 +0700, Artem Yazkov wrote:

> Restrictions:
> 1.   Uninterrupted   supply  of  statistics  collector  necessary  for
> efficient use of this algorithm.

In my understanding, we do not guarantee this. That leaves the rest of
your ideas drifting, I'm sorry to say. Your ideas and analysis did seem
good though, so please don't be put off.

> 2. Works only for simplest queries like:
>      select count (*) from regular_table

Personally, I don't see the need to make just that single statement go
faster. It only runs slowly on large tables and they seldom need exactly
accurate counts frequently enough for us to care. Or put it another way,
I never saw a real application where this was a significant performance
issue, on any RDBMS.

I believe this is a marketing issue for us, only. Other RDBMS supporters
know count(*) runs slower on PostgreSQL and use that as evidence of poor
performance.

We do need a general solution to improving the performance of
aggregates, though that is already roughly on the TODO in the shape of
materialized view support.

--  Simon Riggs 2ndQuadrant  http://www.2ndQuadrant.com 
 PostgreSQL UK 2008 Conference: http://www.postgresql.org.uk



pgsql-hackers by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: [PATCHES] Fix for large file support (nonsegment mode support)
Next
From: "Nikolay Samokhvalov"
Date:
Subject: Multiple SRF right after SELECT