Re: pg_upgrade —link does it remove table bloat - Mailing list pgsql-general

From Adrian Klaver
Subject Re: pg_upgrade —link does it remove table bloat
Date
Msg-id a265e511-c00f-16dc-4a80-0e690bd0f10b@aklaver.com
Whole thread Raw
In response to RE: pg_upgrade —link does it remove table bloat  (Jason Ralph <jralph@affinitysolutions.com>)
List pgsql-general
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
deadtuples whose space has not been marked > as available for reuse by VACUUM or whose space has been returned to the
OSwith 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
tablewill contain the same amount of bloat(dead tuples)?  Meaning its not the same as pg_dump / pg_restore since it’s a
hardlink 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=69fcd70a7c526d9f27b43a49f71e9b591a6b889f;hb=HEAD7

> 
> Jason Ralph


-- 
Adrian Klaver
adrian.klaver@aklaver.com



pgsql-general by date:

Previous
From: Jason Ralph
Date:
Subject: RE: pg_upgrade —link does it remove table bloat
Next
From: Jason Ralph
Date:
Subject: RE: pg_upgrade —link does it remove table bloat