Re: Why count(*) doest use index?

From: Glenn Maynard <glenn(at)zewt(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Why count(*) doest use index?
Date: 2011-03-06 20:57:29
Message-ID: AANLkTikdXqVPCSTthxDWqN_BQ9vt5XOPAXLwhsjOvRTO@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Mar 6, 2011 at 5:41 AM, Martijn van Oosterhout <kleptog(at)svana(dot)org>wrote:

> If it's really really important there are ways you can use trigger
> tables and summary views to achieve the results you want. Except it's
> expensive and when people are told that all of the sudden the count(*)
> performance isn't so important any more. :)
>

That's often perfectly fine, with read-heavy, single-writer workloads.

I definitely wish there was a way to create indexes to track counters on
various types of queries, even if it eliminates write concurrency on
affected writes. Doing it by hand is a pain.

--
Glenn Maynard

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dimitri Fontaine 2011-03-06 21:18:48 Re: How to Create Table from CSV
Previous Message Dimitri Fontaine 2011-03-06 20:55:54 Re: FTS and words near one another