8.x VACUUM overestimates reltuples?
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/
Michael Fuhr <mike@fuhr.org> writes:
Is VACUUM in 8.x supposed to be overestimating reltuples by 50% of
the number of dead tuples?
See this thread:
http://archives.postgresql.org/pgsql-hackers/2004-11/msg01043.php
regards, tom lane
On Sat, Feb 12, 2005 at 01:16:49AM -0500, Tom Lane wrote:
Michael Fuhr <mike@fuhr.org> writes:
Is VACUUM in 8.x supposed to be overestimating reltuples by 50% of
the number of dead tuples?See this thread:
http://archives.postgresql.org/pgsql-hackers/2004-11/msg01043.php
Thanks -- not sure how I missed that thread in my searches. I
wondered if the reason might be what your message talks about but
I wanted to check.
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/