Re: Vacuum as "easily obtained" locks

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Graham <mgraham(at)bloxx(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Vacuum as "easily obtained" locks
Date: 2011-08-03 14:17:52
Message-ID: 16086.1312381072@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Michael Graham <mgraham(at)bloxx(dot)com> writes:
> 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?

It means that AccessExclusiveLock can be obtained without waiting, ie,
there is nothing else accessing the table at the instant VACUUM decides
to try to truncate the file.

> Would my applications
> constant polling of the queue mean that the lock could not be easily
> obtained?

Very possible, depending on what duty cycle is involved there.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2011-08-03 14:22:01 Re: Vacuum as "easily obtained" locks
Previous Message Andy Colson 2011-08-03 14:03:05 Re: Vacuum as "easily obtained" locks