Re: Thanks, naming conventions, and count()

From: Casey Lyon <casey(at)earthcars(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Thanks, naming conventions, and count()
Date: 2001-04-30 03:38:53
Message-ID: 3AECDE4D.5060608@earthcars.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian wrote:


> The problem here is that now we don't have commit status in the index
> rows, so they have to check the heap for every row. One idea is to
> update the index status on an index scan, and if we can do that, we can
> easily use the index. However, the table scan is pretty quick.

It certainly works quickly for smaller tables, however the 21.7 million
record table I ran this on takes a touch longer as shown here:

database=# explain select count(*) from table;
NOTICE: QUERY PLAN:

Aggregate (cost=478056.20..478056.20 rows=1 width=0)
-> Seq Scan on table (cost=0.00..423737.76 rows=21727376 width=0)

EXPLAIN

However I noted explain provides rows as part of it's data; from what
I've seen this loses precision over time or with large data imports,
though; at least until the table is vacuumed again.

-Casey

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message The Hermit Hacker 2001-04-30 03:42:24 Re: Thanks, naming conventions, and count()
Previous Message Casey Lyon 2001-04-30 03:30:47 Re: Thanks, naming conventions, and count()