Hi
I use PostgreSQL 7.2.3 on i686-pc-linux-gnu, compiled by GCC
2.95.3 . count(*) very slowly.
CREATE TABLE r2 (
r2_id int4 NOT NULL,
a int4 DEFAULT 1,
label varchar(255),
CONSTRAINT r2_pkey PRIMARY KEY (r2_id)
) WITH OIDS;
insert into r2 select * from r; # The table with the same structure
vacuum;
select count(*) from r2;
Aggregate (cost=100010594.30..100010594.30 rows=1 width=0)
-> Seq Scan on r2 (cost=100000000.00..100009620.04 rows=389704 width=0)
Why not used primary key index?
(But select * from r2 where r2_id=1111111; uses this index)
--
Konstantin