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

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, David Steele <david(at)pgmasters(dot)net>, Andres Freund <andres(at)anarazel(dot)de>, "Bossart, Nathan" <bossartn(at)amazon(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Julien Rouhaud <rjuju123(at)gmail(dot)com>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, "Jamison, Kirk" <k(dot)jamison(at)jp(dot)fujitsu(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: reloption to prevent VACUUM from truncating empty pages at the end of relation
Date: 2019-04-04 11:19:03
Message-ID: CAD21AoCuF+NCVFOYFedAS=4htV9XHdRNdAZ_P6tubh=nhWUMXg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Apr 4, 2019 at 1:26 PM Tsunakawa, Takayuki
<tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com> wrote:
>
> From: Fujii Masao [mailto:masao(dot)fujii(at)gmail(dot)com]
> > reloption for TOAST is also required?
>
> # I've come back to the office earlier than planned...
>
> Hm, there's no reason to not provide toast.vacuum_shrink_enabled. Done with the attached patch.
>

Thank you for updating the patch!

+ <term><literal>vacuum_shrink_enabled</literal>,
<literal>toast.vacuum_shrink_enabled</literal>
(<type>boolean</type>)</term>
+ <listitem>
+ <para>
+ Enables or disables shrinking the table when it's vacuumed.
+ This also applies to autovacuum.
+ The default is true. If true, VACUUM frees empty pages at the
end of the table.

"VACUUM" needs <command> or "vacuum" is more appropriate here?

+ Shrinking the table requires <literal>ACCESS EXCLUSIVE</literal>
lock on the table.
+ It can take non-negligible time when the shared buffer is large.
Besides, <literal>ACCESS EXCLUSIVE</literal>
+ lock could lead to query cancellation on the standby server.
+ If the workload is likely to reuse the freed space soon
+ (e.g., UPDATE-heavy, or new rows will be added after deleting
+ old rows), setting this parameter to false makes sense to avoid
unnecessary shrinking.
+ </para>
+ </listitem>
+ </varlistentry>

The format of the documentation of new option is a bit weird. Could it
be possible to adjust it around 80 characters per line like other
description?

I'm not sure the consensus we got here but we don't make the vacuum
command option for this?

Regards,

--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2019-04-04 11:19:44 Re: pg_rewind vs superuser
Previous Message Ashutosh Sharma 2019-04-04 11:06:41 Re: Server Crash due to assertion failure in _bt_check_unique()