Re: huge SubtransSLRU and SubtransBuffer wait_event

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Nikolay Samokhvalov <samokhvalov(at)gmail(dot)com>, pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: huge SubtransSLRU and SubtransBuffer wait_event
Date: 2024-02-02 10:31:19
Message-ID: 2b019310739379c9eea5d922d2646e04fb1f2ac8.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Fri, 2024-02-02 at 02:04 -0800, Nikolay Samokhvalov wrote:
> On Thu, Feb 1, 2024 at 04:42 Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at> wrote:
> > Today, the only feasible solution is not to create more than 64 subtransactions
> > (savepoints or PL/pgSQL EXCEPTION clauses) per transaction.
>
> I think 64+ nesting level is quite rare

It doesn't have to be 64 *nested* subtransactions. This is enough:

CREATE TABLE tab (x integer);

DO
$$DECLARE
i integer;
BEGIN
FOR i IN 1..70 LOOP
BEGIN
INSERT INTO tab VALUES (i);
EXCEPTION
WHEN unique_violation THEN
NULL; -- ignore
END;
END LOOP;
END;$$;

Yours,
Laurenz Albe

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message James Pang (chaolpan) 2024-02-06 06:59:11 RE: huge SubtransSLRU and SubtransBuffer wait_event
Previous Message Nikolay Samokhvalov 2024-02-02 10:04:02 Re: huge SubtransSLRU and SubtransBuffer wait_event