From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Jason Ralph <jralph@affinitysolutions.com>
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: pg_upgrade —link does it remove table bloat
Date: Thu, 13 Feb 2020 10:16:09 -0800
Message-ID: <a265e511-c00f-16dc-4a80-0e690bd0f10b@aklaver.com> (raw)
In-Reply-To: <BN7PR04MB3826BC0C08FFEA1D680440DFD01A0@BN7PR04MB3826.namprd04.prod.outlook.com>
References: <BN7PR04MB382636FF273A9E543B970468D01A0@BN7PR04MB3826.namprd04.prod.outlook.com>
<b9a6da6f-8196-f485-5c45-6437c58ee812@aklaver.com>
<BN7PR04MB3826BC0C08FFEA1D680440DFD01A0@BN7PR04MB3826.namprd04.prod.outlook.com>
On 2/13/20 10:04 AM, Jason Ralph wrote:
>> Well table bloat and table statistics are two different things. Bloat is the accumulation of dead or potentially dead tuples whose space has not been marked > as available for reuse by VACUUM or whose space has been returned to the OS with VACUUM FULL. For more information see:
>
> Thanks for the helpful response @Adrian Klaver,
> Let me try to rephrase my question,
> If a table has bloat before the upgrade, autvacuum was not aggressive enough, once pg_upgrade is complete, the same table will contain the same amount of bloat(dead tuples)? Meaning its not the same as pg_dump / pg_restore since it’s a hard link to the previous data location. Pg_upgrade with link will not recreate the table.
Yes pg_upgrade is a transfer of the binary data(sort of) whereas
pg_dump/restore is a logical transfer. So pg_upgrade via copy/clone/link
will not recreate user tables. For a good overview see IMPLEMENTATION
file in src:
https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/bin/pg_upgrade/IMPLEMENTATION;h=69f...>
> Jason Ralph
--
Adrian Klaver
adrian.klaver@aklaver.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: adrian.klaver@aklaver.com, jralph@affinitysolutions.com
Subject: Re: pg_upgrade —link does it remove table bloat
In-Reply-To: <a265e511-c00f-16dc-4a80-0e690bd0f10b@aklaver.com>
References: <BN7PR04MB382636FF273A9E543B970468D01A0@BN7PR04MB3826.namprd04.prod.outlook.com> <b9a6da6f-8196-f485-5c45-6437c58ee812@aklaver.com> <BN7PR04MB3826BC0C08FFEA1D680440DFD01A0@BN7PR04MB3826.namprd04.prod.outlook.com> <a265e511-c00f-16dc-4a80-0e690bd0f10b@aklaver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox