8.x VACUUM overestimates reltuples? - Mailing list pgsql-hackers

From Michael Fuhr
Subject 8.x VACUUM overestimates reltuples?
Date
Msg-id 20050212060634.GA72853@winnie.fuhr.org
Whole thread Raw
Responses Re: 8.x VACUUM overestimates reltuples?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Is VACUUM in 8.x supposed to be overestimating reltuples by 50% of
the number of dead tuples?

CREATE TABLE foo (x integer);
INSERT INTO foo SELECT * FROM generate_series(1, 1000);
UPDATE foo SET x = x;
UPDATE foo SET x = x;
UPDATE foo SET x = x;
VACUUM foo;
SELECT relpages, reltuples FROM pg_class WHERE relname = 'foo';relpages | reltuples 
----------+-----------      22 |      2500

Another VACUUM at this point brings reltuples back to the actual
number of rows in the table:

VACUUM foo;
SELECT relpages, reltuples FROM pg_class WHERE relname = 'foo';relpages | reltuples 
----------+-----------      22 |      1000

Is this intentional?

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [GENERAL] WARNING: could not remove database directory
Next
From: Tom Lane
Date:
Subject: Re: 8.x VACUUM overestimates reltuples?