Big number of "unused" pages as reported by VACUUM - Mailing list pgsql-patches

From Yury Bokhoncovich
Subject Big number of "unused" pages as reported by VACUUM
Date
Msg-id Pine.LNX.4.33.0209061228190.7321-100000@panda.center-f1.ru
Whole thread Raw
Responses Re: Big number of "unused" pages as reported by VACUUM  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-patches
Hello!

Some time ago I've got troubles with performance of my PG.
After investigation I had found that the most probable reason was the big
number of "unused" pages. Below follows what VACUUM reported:

=======================
vacuum verbose goods;
NOTICE:  --Relation goods--
NOTICE:  Pages 15068: Changed 0, Empty 0; Tup 16157: Vac 0, Keep 0, UnUsed 465938.
=======================
select count(*) from goods;
 count
-------
 16157
=======================

The same schema with the almost identical number of rows gives completely
different result on another table:
=======================
vacuum verbose goods;
NOTICE:  --Relation goods--
NOTICE:  Pages 912: Changed 0, Empty 0; Tup 11209: Vac 0, Keep 0, UnUsed
19778.
=======================
select count(*) from goods;
 count
-------
 11209
=======================

Two questions:

1) Where to seek the real source of the enormous big number of unused
pages?

2) How to shrink the table (i.e. how can I get rid those unused pages)?

PG: was 7.2.1, now 7.2.2.

--
WBR, Yury Bokhoncovich, Senior System Administrator, NOC of F1 Group.
Phone: +7 (3832) 106228, ext.140, E-mail: byg@center-f1.ru.
Unix is like a wigwam -- no Gates, no Windows, and an Apache inside.



pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [BUGS] Bug #756: suggestion: file with password instead
Next
From: Bruce Momjian
Date:
Subject: Re: Big number of "unused" pages as reported by VACUUM