Vacuum as "easily obtained" locks

From: Michael Graham <mgraham(at)bloxx(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Vacuum as "easily obtained" locks
Date: 2011-08-03 09:47:24
Message-ID: 1312364844.24461.48.camel@brutus
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,

I have an application that is reading from a queue table, as part of my
testing I stressed the table to check performance, but after the test
was completed I have the a very large empty table:

SELECT relname, pg_size_pretty(pg_relation_size(oid)) AS size,
reltuples::bigint FROM pg_class;

relname | size | reltuples
----------------------------+----------+-----------
logdata5queue | 142 GB | 0

From reading the documentation I see that postgres would return this
space to that system after a normal vacuum if "one or more pages at the
end of a table become entirely free and an exclusive table lock can be
easily obtained".

What does "easily obtained" mean in this context? Would my applications
constant polling of the queue mean that the lock could not be easily
obtained?

Cheers,
--
Michael Graham <mgraham(at)bloxx(dot)com>

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sergey Konoplev 2011-08-03 10:35:43 Odd VACUUM behavior when it is expected to truncate last empty pages
Previous Message Albe Laurenz 2011-08-03 07:47:56 Re: pg_largeobject vs pg_toast_XXXX