Re: table bloat very fast and free space can not be reused

From: Kristjan Mustkivi <sonicmonkey(at)gmail(dot)com>
To: James Pang <jamespang886(at)gmail(dot)com>
Cc: pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: table bloat very fast and free space can not be reused
Date: 2026-04-19 11:43:47
Message-ID: CAOQPKatQ0NCP5vDCZ_pz_JQkyM+AP=nPL5wPY3awWVoZXA4T1A@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Sun, Apr 19, 2026 at 4:28 AM James Pang <jamespang886(at)gmail(dot)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.

Hi,

We have had the exact same problem in the past - a large json column
getting very frequent updates (hundreds even thousand per minute) on
the source and the replica side table bloating up. No amount of tuning
attempts made any difference (conversion of json to text, different
table specific autovacuum settings etc). Eventually, the table was
taken out of the replication and later on made UNLOGGED which also
freed up a giant swathes of storage from WAL written. Such design was
then called an antipattern and has not been allowed since.

With best regards,

Kristjan

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message David Rowley 2026-04-20 04:40:37 Re: Significant performance issues with array_agg() + HashAggregate plans on Postgres 17
Previous Message James Pang 2026-04-19 07:22:51 Re: table bloat very fast and free space can not be reused