Re: LWLock contention: I think I understand the problem - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: LWLock contention: I think I understand the problem
Date
Msg-id 200201231910.g0NJARm29656@candle.pha.pa.us
Whole thread Raw
In response to Re: LWLock contention: I think I understand the problem  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: LWLock contention: I think I understand the problem  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> Hannu Krosing <hannu@tm.ee> writes:
> > Was it not the case that instead of locking whole tables the new 
> > vacuum locks only one page at a time. If it can't lock that page it 
> > just moves to next one instead of waiting for other backend to release 
> > its lock.
> 
> No, it just waits till it can get the page lock.
> 
> The only conditional part of the new vacuum algorithm is truncation of
> the relation file (releasing empty end pages back to the OS).  That
> requires exclusive lock on the relation, which it will not be able to
> get if there are any other users of the relation.  In that case it
> forgets about truncation and just leaves the empty pages as free space.

If we have one page with data, and 100 empty pages, and another page
with data on the end, will VACUUM shrink that to two pages if no one is
accessing the table, or does it do _only_ intra-page moves.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Savepoints
Next
From: Tom Lane
Date:
Subject: Re: Schemas vs. PostQUEL: resolving qualified identifiers