Re: Indices for select count(*)?

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Indices for select count(*)?
Date: 2005-12-23 15:12:37
Message-ID: 200512231612.37801.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

One way to conceptually tackle this count(*) issue would be to create a new
index type for it. The index type would (logically) just need to implement
insert and delete operations and keep a running count with a big lock around
it. Users could then choose to trade off concurrent performance against the
speed of count() by creating or dropping that index. Implementing that type
of index might not even be that hard but convincing the planer and executor
to use it without too many hardcoded cases seems more challenging.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-12-23 15:22:55 Re: query for a time interval
Previous Message Mike Rylander 2005-12-23 15:08:35 Re: Inheritance Algebra