public inbox for pgsql-performance@postgresql.org  
help / color / mirror / Atom feed
From: Christophe Pettus <xof@thebuild.com>
To: James Pang <jamespang886@gmail.com>
Cc: pgsql-performance@lists.postgresql.org
Subject: Re: table bloat very fast and free space can not be reused
Date: Sat, 18 Apr 2026 20:56:52 -0700
Message-ID: <6EEE234B-D3DC-48D9-97EE-0A86D63554BC@thebuild.com> (raw)
In-Reply-To: <CAHgTRff=eH1GwVb=ENMzX6hBEajdTccCQbeVRkj4OtYLm69a9g@mail.gmail.com>
References: <CAHgTRff=eH1GwVb=ENMzX6hBEajdTccCQbeVRkj4OtYLm69a9g@mail.gmail.com>



> On Apr 18, 2026, at 18:28, James Pang <jamespang886@gmail.com> wrote:
> 
> experts:
>      source database v14 ,  pglogical extension 2.4.5 replication to new 17, source table very frequent UPDATEs /DELETES /INSERTS and has two text and jsonb. in source database, application update/delete/insert through SQL, table size did not increased quickly. but in target pg v17 , by pglogical apply, we found table increased very quickly , table size got doubled in days.  
>     Vacuum analyze did not help , only vacuum full can help. pgstattuple show most of space are free space , that much more than source.  it looks like these replicate DML always asking new pages instead of reuse existing freespace. 
>     Thanks,
> 
> James

Hello,

1. First, are you *sure* that the free space is the source of the bloat, and not dead tuples?  Could you share the queries you ran to detrmine this?

2. Have you set fillfactor to anything besides 100 on either the source or the destination?

3. You might consider using in-core logical replication rather than pglogical for this.  By PostgreSQL v14, in-core logical replication is likely a better choice.

Best,
-- Christophe




reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: xof@thebuild.com, jamespang886@gmail.com, pgsql-performance@lists.postgresql.org
  Subject: Re: table bloat very fast and free space can not be reused
  In-Reply-To: <6EEE234B-D3DC-48D9-97EE-0A86D63554BC@thebuild.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox