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 1wAtb6-000XrD-1Q for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Apr 2026 17:55:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wAtb4-006vvQ-1r for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Apr 2026 17:55:19 +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 1wAtb4-006vvH-0U for pgsql-hackers@lists.postgresql.org; Thu, 09 Apr 2026 17:55:19 +0000 Received: from forwardcorp1a.mail.yandex.net ([2a02:6b8:c0e:500:1:45:d181:df01]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wAtb2-00000000Djg-2st0 for pgsql-hackers@postgresql.org; Thu, 09 Apr 2026 17:55:18 +0000 Received: from mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net [IPv6:2a02:6b8:c2d:3530:0:640:eca4:0]) by forwardcorp1a.mail.yandex.net (Yandex) with ESMTPS id E982EC01AE; Thu, 09 Apr 2026 20:55:13 +0300 (MSK) Received: from smtpclient.apple (unknown [2a02:6bf:8080:b94::1:9]) by mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id CtKdus0KI8c0-o7fWvQI7; Thu, 09 Apr 2026 20:55:13 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1775757313; bh=ZhSnx221/slggybGUsNW/G0y2IZ8q57s+MofCtEiuDY=; h=Message-Id:To:Date:References:Cc:In-Reply-To:From:Subject; b=X9YY8SuhUjiEkYuMUpSdYYkX8RPIipfFR2dOAgkW7pndjCmQjj+MnDu22iuJgdNNJ YO0NxkFhWVetpEhK7sEsOeGh5o2wZOPX8XNe0oEoe9gIecbZsdRsNW9B1ioW1qWQYh GB+IbhmdVHSl4VKRLP+3YF/4LSELYQUEd7GMUUWI= Authentication-Results: mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.500.181\)) Subject: Re: Compress prune/freeze records with Delta Frame of Reference algorithm From: Andrey Borodin In-Reply-To: Date: Thu, 9 Apr 2026 22:55:01 +0500 Cc: Evgeny Voropaev , Tomas Vondra , PostgreSQL Hackers Content-Transfer-Encoding: quoted-printable Message-Id: <9381130C-B961-4DAF-B950-E4ABFCE4CCA0@yandex-team.ru> References: <5a2f3df2-a736-4ada-8aa3-aa6e20b2e067@vondra.me> <3fc9f40b-2c4f-49c7-bf1c-570c5b9e6e9e@tantorlabs.com> To: Andres Freund X-Mailer: Apple Mail (2.3864.500.181) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 9 Apr 2026, at 21:50, Andres Freund wrote: >=20 > These numbers make the impact sound bigger than I think it really is: >=20 > - They neglect that the insert generates ~183MB of WAL, the delete = ~161MB > without indexes and ~243MB / 161MB with. In contrast to that 6.7Mb = isn't > particularly significant. Well, vacuuming of a bloated tables does happen. The amount of WAL = needed to accumulate bloat does not invalidate benefits of reducing WAL needed to = vacuum bloat. > - Workloads deleting almost all records in the table but leaving some = in to > prevent truncation aren't particularly common. Queue tables may be kind of antipattern, yet users use such tables. And = sometimes they tend to have ~90% bloat. And cause 99% of problems. > - The narrowness of the rows (~30 bytes, with row header) makes the = wins much > bigger than they'd be in realistic cases It=E2=80=99s crafted benchmark to demonstrate bright side. It=E2=80=99s = also super easy to demonstrate the case when proposed patch does not give any benefit at all. Evgeny, do you know of any cases when the patch has negative effect? I think if it=E2=80=99s strictly non-negative - then we can just weight = complexity of maintaining the proposed approach against benefits. > - The workload doesn't involve any FPIs. It's much more common to have > vacuum's occur later and trigger FPIs. AFAIU, without special handling FPIs will not substitute xl_heap_prune, = will they? > Heh. In this case FPIs actually would *reduce* the overhead of the = current > code, because the page is so empty after all the deletes that the FPI = uses > less space than the update . It's 4.1MB when not using indexes and = not using > wal compression and 1MB with wal compression. >=20 > Seems we could get a fair bit of benefit by just using a heuristic to = switch > to an FPI when there are enough changes. I think we could even do it in a generic way: if the record body is = heavier that its FPIs - just do FPIs only. Best regards, Andrey Borodin.=