Re: COUNT(*) again (was Re: [HACKERS] Index/Function

From: Hannu Krosing <hannu(at)tm(dot)ee>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Christopher Browne <cbbrowne(at)libertyrms(dot)info>, pgsql-performance(at)postgresql(dot)org, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: COUNT(*) again (was Re: [HACKERS] Index/Function
Date: 2003-10-04 20:59:00
Message-ID: 1065301140.2746.37.camel@fuji.krosing.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-performance

Tom Lane kirjutas L, 04.10.2003 kell 19:07:
> Hannu Krosing <hannu(at)tm(dot)ee> writes:
> > Christopher Browne kirjutas R, 03.10.2003 kell 00:57:
> >> A while back I outlined how this would have to be done, and for it to
> >> be done efficiently, it would be anything BUT simple.
>
> > Could this be made a TODO item, perhaps with your attack plan.
>
> If I recall that discussion correctly, no one including Christopher
> thought the attack plan was actually reasonable.
>
> What this keeps coming down to is that an optimization that helps only
> COUNT(*)-of-one-table-with-no-WHERE-clause would be too expensive in
> development and maintenance effort to justify its existence.

Please read further in my email ;)

The point I was trying to make was that faster count(*)'s is just a side
effect. If we could (conditionally) keep visibility info in indexes,
then this would also solve the problem fo much more tricky question of
index-structured tables.

Count(*) is *not* the only query that could benefit from not needing to
go to actual data table for visibilty info, The much more needed case
would be the "inveres time series" type of queries, which would
otherways trash cache pages badly.

----------------------------
Hannu

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2003-10-04 21:08:57 Re: max_connections/shared_buffers (was Re: Beta4 Tag'd and Bundled ...)
Previous Message Tom Lane 2003-10-04 19:58:35 Re: [HACKERS] initdb

Browse pgsql-performance by date

  From Date Subject
Next Message James Rogers 2003-10-04 21:15:12 Uses for Index/Function organizing
Previous Message Tom Lane 2003-10-04 18:34:32 Re: count(*) slow on large tables