Re: Improve the concurency of vacuum full table and select statement on the same relation - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Improve the concurency of vacuum full table and select statement on the same relation
Date
Msg-id 48375.1444491281@sss.pgh.pa.us
Whole thread Raw
In response to Improve the concurency of vacuum full table and select statement on the same relation  (Jinyu <call_jinyu@126.com>)
Responses Re: Improve the concurency of vacuum full table and select statement on the same relation  (Jinyu <call_jinyu@126.com>)
List pgsql-hackers
Jinyu <call_jinyu@126.com> writes:
> Proposal:  vacuum full table takes an ExclusiveLock on relation instead of AccessExclusiveLock at start. It can'
blockselect statement before call function "finish_heap_swap". and select statement is safe because vacuum full table
copystuples from old relation to new relation before calling function "finish_heap_swap". But it must take an
AccessExclusiveLockon relation when call function "finish_heap_swap" in order to block select statement on the same
relation.

> This solution can improve the concurency. the following shows the reasons.

What it's more likely to do is cause the vacuum full to fail altogether,
after doing a lot of work.  Lock upgrade is a bad thing because it tends
to result in deadlocks.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Dmitry Vasilyev
Date:
Subject: Re: Postgres service stops when I kill client backend on Windows
Next
From: Tom Lane
Date:
Subject: Re: Postgres service stops when I kill client backend on Windows