Re: fast count(*) through statistics collector

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Artem Yazkov <markkrass(at)inbox(dot)ru>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: fast count(*) through statistics collector
Date: 2008-03-19 07:06:52
Message-ID: 24335.1205910412@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Artem Yazkov <markkrass(at)inbox(dot)ru> writes:
> By viewing this list, I see a lot of discussions on the problem of
> "fast count (*)", but acceptable decision have not been formulated.
> Well, I make bold to propose own view on the problem.

A number of the things you suggest would be good for improving the
performance of the stats subsystem. But I think you have failed to
grasp two pretty fundamental issues: (1) the correct answer to count(*)
varies depending on the observer's snapshot, and (2) the stats subsystem
is built to provide approximate answers not exact ones.

I encourage you to work on fixing the stats subsystem's performance
issues ... but if you think that's going to provide a substitute for
count(*), you're mistaken.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message NikhilS 2008-03-19 07:51:48 Re: Problem identifying constraints which should not be inherited
Previous Message Manolo 2008-03-19 06:17:53 Re: CVS problems