Re: does "select count(*) from mytable" always do a seq

From: Scott Ribe <scott_ribe(at)killerbytes(dot)com>
To: <alex(at)neteconomist(dot)com>
Cc: Postgresql-General <pgsql-general(at)postgresql(dot)org>
Subject: Re: does "select count(*) from mytable" always do a seq
Date: 2005-01-07 18:17:32
Message-ID: BE04204C.14A0C%scott_ribe@killerbytes.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> I guess what I"m really asking is why can't you run aggregates over an index?

It's got to do with MVCC and transaction consistency. Running count(*) or an
aggregate function on an index could include records that should not be
visible to your current transaction.

--
Scott Ribe
scott_ribe(at)killerbytes(dot)com
http://www.killerbytes.com/
(303) 665-7007 voice

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message ON.KG 2005-01-07 18:17:36 PL/Perl
Previous Message John Doggett 2005-01-07 18:03:28 Re: need help Connect failure in an applet