Re: Regarding huge logical slot lag between source and target

From: Manu <manuelreyesbravo(at)gmail(dot)com>
To: Durgamahesh Manne <maheshpostgres9(at)gmail(dot)com>
Cc: Justin <zzzzz(dot)graf(at)gmail(dot)com>, pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Subject: Re: Regarding huge logical slot lag between source and target
Date: 2026-10-28 01:45:32
Message-ID: 179315193265.229344.14391806374538325287@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Durga,

On Tue, Oct 27, 2026 at 10:35 AM Durgamahesh Manne
<maheshpostgres9(at)gmail(dot)com> wrote:
> which one would be good and work efficiently 1st or 2nd.

The first, the row filters you already have. In my lab they drained a
backlog at 1.9x and 2.0x the rate of one subscription, the partitions
at 1.8x and 1.9x, and they spare you rebuilding the table.

Both share two costs: each walsender decodes all the WAL before its
filter drops the other rows (together the four used about 5x the CPU
of one, for twice the drain), and a transaction that spans filters is
applied in pieces, not atomically.

If your filters use abs() on a hash, use (hashint8(id) & 3) = 0, 1, 2
and 3 instead: a row hashing to -2147483648 makes abs() fail and stops
all four.

As Justin says, check where the time goes first (CPU and wait_event as
in my last mail): splitting only helps if the apply worker is near
100% CPU.

With 4 CPU threads per side and two runs per case, take the ratios
rather than the rates. Details in the attached measurements.txt.

Regards,
Manu

Attachment Content-Type Size
measurements.txt text/plain 5.4 KB

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rei Monsura 2026-10-28 05:27:42 Compatibility Confirmation – PostgreSQL 11 and Windows Server 2019
Previous Message yuvaraj ganapathy 2026-10-27 22:19:21 Re: PostgreSQL 17 — Native Password Policy Support