Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wEQZH-003zOI-2t for pgsql-performance@arkaria.postgresql.org; Sun, 19 Apr 2026 11:44:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wEQZG-00F6C6-27 for pgsql-performance@arkaria.postgresql.org; Sun, 19 Apr 2026 11:44:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wEQZG-00F6Bx-0v for pgsql-performance@lists.postgresql.org; Sun, 19 Apr 2026 11:44:02 +0000 Received: from mail-yw1-x1134.google.com ([2607:f8b0:4864:20::1134]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wEQZE-00000001y3E-03pd for pgsql-performance@lists.postgresql.org; Sun, 19 Apr 2026 11:44:02 +0000 Received: by mail-yw1-x1134.google.com with SMTP id 00721157ae682-79853c0f5b9so29053547b3.0 for ; Sun, 19 Apr 2026 04:43:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776599038; cv=none; d=google.com; s=arc-20240605; b=Jct8L04MRb9cnsbE8Zzg9baoRMm2Ok8Meg940dVmyuNojyAWyUiBi6RPGPRmZCAg5Y iZHGHVeNu1+05D9JMbs4cAZ6kQgJFO17dTw8dGdx3C5zvPLRcptOcHF22WRQ0wYddiRW fEhVqVxn3vY3lGQZTDusjfWONlUacBmtg13fQJHzmennzFfPoL5LvdLZOek2Sqql5oRC fwogL38/HDPNVl9mpCoMUTkZ2ZtSMWM+MQooQe3mFTWYryxqKnOB7FepaMwdVblHc5z2 0qTSsPSfv54BDksdqc/9lkKVYuyEocNCxKdFEse/PXDERFTOFQUmda5qNde2q30OnUmD mDng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=jrmIlVA6kg8FNBa1u+8yTPBgKT3Gr05mij2cwcZGX7Y=; fh=RCIqORqqV3G1flMXtj+AA0dWCpCKnNrRlFHZC0WCCwQ=; b=PFCPxg4uiy6xizacjyf0z4kIgz3fHrIxjdeGZsUpZEHkXNa1A6qepodbPWt4wX/Sxh QraxCR5ohbaxkMYXHu/f6h2zMTARpjK/UHVTmgROkZNOC19O4Xqaow9URJ7LEx4t1YQd 75hC1O3SvYYGlfKBHpL0WV/PS67BT8PdRjMkkfeFQ/HhTvg+wSFS0Zr2Y4w1juXC0Dbe eyx+OqKU1blotju5uiy2UgCUri8NCCrmlmo/g4iJCr7kpw4I9TaFj9cXSHNSYPf+cdwa 5bQEidGS1oDGxKla3R2BRZhVyIZdC9NBwXwd/DdNw1HNIU0mHfBT3oNN7cCckF3Q+ri3 j7Qg==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776599038; x=1777203838; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=jrmIlVA6kg8FNBa1u+8yTPBgKT3Gr05mij2cwcZGX7Y=; b=B/2bLWjOk26R8nbNh1WmtkRydh3KHuAxYjUAjLE7vuVEANYl6zwnik6lgiOiTuCCZH jg0piqZdRz0ow1Cc4Yzc1EQiQOESp40ZFO0gnxUYsiudFT/uOIobxTbuO73QIygWjo5+ ZgJTvY+UCN0o35cRnT21EN4Ey7eFk2oujxoYC033coS+MkNDTz+awAYbvGdEPpekwYbm /E/7PtBxgqlPxXwwEKzTZ7ycPMj1j0y74C1HG8L0z8Ihssz4lqwnREgbnfmzQsXj8ocA MuTSuFnJ7GKc3zJZ8XnTUIocVkO2cwTiyixRoW+pZvEnYMAx56qpUkc9KoINR+uVKVNt 7H2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776599038; x=1777203838; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=jrmIlVA6kg8FNBa1u+8yTPBgKT3Gr05mij2cwcZGX7Y=; b=RoGOyBvRL2/lKlbEqjL3BMKPDJxP303HU81X0ntl7gpEFiAE8QI1CqIY0pIrT0NHpV RfCFwjfmtWjF8GyYaAwDTtPXWzY4mkvWLf2l44oHwTj4Jkh1zCr2zkxMMAb0Gph1bPBm YpoHF+HF/H+7/AdH35h0PUfNi5A8HaHyRlhboqNDEBZp/5k0IpTaRrSjbhkjKaH9VLjS 3FRB5mhFJMqJZI+Q+QuCqSNhXfhGMZElr306pR6JL5cAnVAYax/l9jpPMrWkNPp8DM10 hpHMynTsLhcCotU2GV6EjIx5cnIKOUMCLlVxLmLV6K7OiOq28kRKj7l2lSao2XAqeEZW 5k1w== X-Gm-Message-State: AOJu0YwQWkN+AM3kZ9LxKQeTQ5H1Z2ldrJajf3yPbIWgKfKxVqVBJJ9f 6vQ3GMH97wrHD4v8QQ8tyiOkR5JI+OU18jl7u2I6o4J5XB9AJWkpLrb70mSvpalKilJbLlxhaS2 btA+dMANbCsGr6xQbgnjtI9z1UIOnxdY= X-Gm-Gg: AeBDiesI/ZDi0bpQh7DjYYsNXiPdrpcV2xHfysqK6OrpuR/6zq85z5CSqUJqwuZW2E/ fVRWJ7zYdLYowJJZ4s1T742B27JTL2c07BCzp/o8j40qouCwBTp/EzM1B9lkK3VoclcsY+951D7 qxGcesIXzpE3pXa+SRuwqUBVb4vdwxohdHQb0uO3I9Xc7lig9Dowm4mxWgseeRgmujSSNpfNFw8 e5xUXoUdog8Pdv4X5RN2Ds406DUY4vxLH18gfJ27HtvB+jjlweP+m2h3JA6UMuUYUSZK/9vhXHR wUpsgA4O+UMAEAxlz22CYos4sd13Qk2FPjWi6MIbKHzm1XR8sfxW8+5QUUJi51f1RCRW4AAfNo1 pMzYIaHumjcOaaxRTpME1mMKJE+M9sd+GW/g= X-Received: by 2002:a05:690c:6e87:b0:7af:6904:3f47 with SMTP id 00721157ae682-7b9ecf8654fmr99812987b3.29.1776599038230; Sun, 19 Apr 2026 04:43:58 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Kristjan Mustkivi Date: Sun, 19 Apr 2026 14:43:47 +0300 X-Gm-Features: AQROBzDc4gQQmxr7qnW8ksnM0Pf6UVkPLSQMfwNhVedDHHW7EBRtxLmYjyEmqSI Message-ID: Subject: Re: table bloat very fast and free space can not be reused To: James Pang Cc: pgsql-performance@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, Apr 19, 2026 at 4:28=E2=80=AFAM James Pang = 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 a= nd 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 da= ys. > 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 l= ike these replicate DML always asking new pages instead of reuse existing f= reespace. 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