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

From Tom Lane
Subject Re: LWLock contention: I think I understand the problem
Date
Msg-id 9390.1010421575@sss.pgh.pa.us
Whole thread Raw
In response to Re: LWLock contention: I think I understand the problem  (Hannu Krosing <hannu@tm.ee>)
Responses Re: LWLock contention: I think I understand the problem  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
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.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Holger Krug
Date:
Subject: Re: ON ERROR triggers
Next
From: Holger Krug
Date:
Subject: Why MemoryContextSwitch in ExecRelCheck ?