Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-hackers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group