Re: Why count(*) doest use index? - Mailing list pgsql-general

From Glenn Maynard
Subject Re: Why count(*) doest use index?
Date
Msg-id AANLkTin_kCyR8VFGnMu2tC7OxjK+00QJ3_4FWS-cLK73@mail.gmail.com
Whole thread Raw
In response to Re: Why count(*) doest use index?  ("Igor Neyman" <ineyman@perceptron.com>)
List pgsql-general
On Tue, Mar 8, 2011 at 10:42 AM, Igor Neyman <ineyman@perceptron.com> wrote:
Indexes don't "maintain counts", indexes maintain pointers to the table
records.

The whole point is that they don't, even if you can afford the costs.

What you need is "materialized view" storing aggregates.
And it looks like you already have it with your triggers.

With cumbersome, awkward triggers, yes.

--
Glenn Maynard

pgsql-general by date:

Previous
From: Andy Colson
Date:
Subject: Re: Using bytea field...
Next
From: akp geek
Date:
Subject: @@ to_tsquery help