Re: Proposal - Reduce lock during first phase of VACUUM TRUNCATE from ACCESS EXCLUSIVE to EXCLUSIVE

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ramanathan <sivakrishnathan(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Proposal - Reduce lock during first phase of VACUUM TRUNCATE from ACCESS EXCLUSIVE to EXCLUSIVE
Date: 2025-02-18 04:50:19
Message-ID: 1168693.1739854219@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ramanathan <sivakrishnathan(at)gmail(dot)com> writes:
> I propose modifying the use of an EXCLUSIVE lock during the backward scan
> phase, then upgrading that lock to ACCESS EXCLUSIVE only for the actual
> truncation phase. Since the truncation phase should be relatively quick,
> the impact of the ACCESS EXCLUSIVE lock should be minimal.

Except that mid-transaction lock upgrades increase the risk of
deadlock failures.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amul Sul 2025-02-18 05:02:26 Re: NOT ENFORCED constraint feature
Previous Message vignesh C 2025-02-18 04:48:07 Re: Adding a '--clean-publisher-objects' option to 'pg_createsubscriber' utility.