Re: reloption to prevent VACUUM from truncating empty pages at the end of relation

Alvaro Herrera <alvherre@2ndquadrant.com>

From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Fujii Masao <masao.fujii@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2018-11-15T08:59:36Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Add TRUNCATE parameter to VACUUM.

  2. Add vacuum_truncate reloption.

  3. Allow VACUUM to be run with index cleanup disabled.

On 2018-Nov-15, Laurenz Albe wrote:

> This new option would not only mitigate the long shared_buffers scan,
> it would also get rid of the replication conflict caused by the
> AccessExclusiveLock taken during truncation, which is discussed in
> https://www.postgresql.org/message-id/c9374921e50a5e8fb1ecf04eb8c6ebc3%40postgrespro.ru
> and seems to be a more difficult problem than anticipated.

FWIW I was just reminded yesterday that the AEL-for-truncation has been
diagnosed to be a severe problem in production, and with no other
solution in sight, I propose to move forward with the stop-gap.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services