Re: Vacuum as "easily obtained" locks - Mailing list pgsql-general

From Tom Lane
Subject Re: Vacuum as "easily obtained" locks
Date
Msg-id 16086.1312381072@sss.pgh.pa.us
Whole thread Raw
In response to Vacuum as "easily obtained" locks  (Michael Graham <mgraham@bloxx.com>)
Responses Re: Vacuum as "easily obtained" locks
Re: Vacuum as "easily obtained" locks
List pgsql-general
Michael Graham <mgraham@bloxx.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

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: Vacuum as "easily obtained" locks
Next
From: Sergey Konoplev
Date:
Subject: Re: Vacuum as "easily obtained" locks