Re: Seqscan rather than Index

From: Frank Wiles <frank(at)wiles(dot)org>
To: "Steinar H(dot) Gunderson" <sgunderson(at)bigfoot(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Seqscan rather than Index
Date: 2004-12-17 23:02:29
Message-ID: 20041217170229.4de276a7.frank@wiles.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Fri, 17 Dec 2004 23:09:07 +0100
"Steinar H. Gunderson" <sgunderson(at)bigfoot(dot)com> wrote:

> On Fri, Dec 17, 2004 at 10:56:27PM +0100, Steinar H. Gunderson wrote:
> > I'm a bit unsure -- should counting ~3 million rows (no OIDs, PG
> > 7.4, everything in cache, 32-byte rows) take ~3500ms on an Athlon 64
> > 2800+?
>
> (I realize I was a bit unclear here. This is a completely separate
> case, not related to the original poster -- I was just wondering if
> what I'm seeing is normal or not.)

It depends more on your disk IO than the processor. Counting isn't
processor intensive, but reading through the entire table on disk
is. I've also seen a huge difference between select count(*) and
select count(1) in older versions, haven't tried it on a recent
version however.

---------------------------------
Frank Wiles <frank(at)wiles(dot)org>
http://www.wiles.org
---------------------------------

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Steinar H. Gunderson 2004-12-17 23:55:48 Re: Seqscan rather than Index
Previous Message Tom Lane 2004-12-17 22:20:47 Re: Error in VACUUM FULL VERBOSE ANALYZE (not enough memory)