Re: SubtransControlLock and performance problems

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Lars Aksel Opsahl <Lars(dot)Opsahl(at)nibio(dot)no>, "pgsql-performance(at)lists(dot)postgresql(dot)org" <pgsql-performance(at)lists(dot)postgresql(dot)org>
Subject: Re: SubtransControlLock and performance problems
Date: 2020-02-17 18:23:16
Message-ID: 9908.1581963796@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
> po 17. 2. 2020 v 17:36 odesílatel Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
> napsal:
>> Either use shorter transactions, or start fewer subtransactions.

> it is interesting topic, but I don't see it in my example

> CREATE OR REPLACE FUNCTION public.fx(integer)
> RETURNS void
> LANGUAGE plpgsql
> AS $function$
> begin
> for i in 1..$1 loop
> begin
> --raise notice 'xx';
> exception when others then
> raise notice 'yyy';
> end;
> end loop;
> end;
> $function$

This example doesn't create or modify any table rows within the
subtransactions, so (I think) we won't assign XIDs to them.
It's consumption of subtransaction XIDs that causes the issue.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Pavel Stehule 2020-02-17 18:41:51 Re: SubtransControlLock and performance problems
Previous Message Pavel Stehule 2020-02-17 18:01:11 Re: SubtransControlLock and performance problems