On Tue, Dec 26, 2006 at 06:12:45PM +0100, Martijn van Oosterhout wrote: > On Tue, Dec 26, 2006 at 12:04:40PM -0500, D'Arcy J.M. Cain wrote: > > Now it certainly seems to me that it should behave as described given > > the definition of VACUUM FULL so I am a little confused by my tests. > > My test table only has two entries in it. Is that the issue? In fact, > > I find the same behaviour if I do a simple VACUUM on the table. > > On a table with two entries, VACUUM FULL is going to do nothing of > interest. Moving tuples within a page is useless, generally.
A test on a larger table shows the behavior: test=> CREATE TABLE foo (x integer); CREATE TABLE test=> INSERT INTO foo SELECT * FROM generate_series(1, 1000); INSERT 0 1000 test=> DELETE FROM foo WHERE x BETWEEN 2 AND 999; DELETE 998 test=> SELECT ctid, x FROM foo; ctid | x --------+------ (0,1) | 1 (4,92) | 1000 (2 rows) test=> VACUUM foo; VACUUM test=> SELECT ctid, x FROM foo; ctid | x --------+------ (0,1) | 1 (4,92) | 1000 (2 rows) test=> VACUUM FULL foo; VACUUM test=> SELECT ctid, x FROM foo; ctid | x -------+------ (0,1) | 1 (0,2) | 1000 (2 rows) -- Michael Fuhr ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster