Odd VACUUM behavior when it is expected to truncate last empty pages - Mailing list pgsql-general

From Sergey Konoplev
Subject Odd VACUUM behavior when it is expected to truncate last empty pages
Date
Msg-id CAL_0b1sQytEusUSnY3Wv=Wh4MePof15TTA0KDKyuNaX_9YRmAA@mail.gmail.com
Whole thread Raw
List pgsql-general
Hi all,

I have PostgreSQL 9.0.3 installed on my Gentoo Linux box. The
configuration is default. There is no any activity in the database but
the described below.

What I am trying to achieve is the effect described in this article
http://blog.endpoint.com/2010/09/reducing-bloat-without-locking.html.
In short I am updating last pages of a table to move the tuples to the
earlier pages to make VACUUM able to truncate the empty tail. However
I faced a strange VACUUM behavior. So the situation is:

1. do some UPDATEs on the table so it has several last pages free,
2. perform VACUUM of this table the 1st time, no tail pages will be
truncated (why?),
3. perform VACUUM the 2nd time straight after the 1st one and it will
truncate the tail pages (why this time?).

The case is stable.

Could anybody explain why it could happen, please?

Here is the VACUUMs verbose http://pastebin.com/RjuDmabV

--
Sergey Konoplev

Blog: http://gray-hemp.blogspot.com /
Linkedin: http://ru.linkedin.com/in/grayhemp /
JID/GTalk: gray.ru@gmail.com / Skype: gray-hemp

pgsql-general by date:

Previous
From: Michael Graham
Date:
Subject: Vacuum as "easily obtained" locks
Next
From: Andy Colson
Date:
Subject: Re: Vacuum as "easily obtained" locks