pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: Lars Aksel Opsahl <Lars.Opsahl@nibio.no>
Cc: pgsql-performance@lists.postgresql.org <pgsql-performance@lists.postgresql.org>
Subject: Re: SubtransControlLock and performance problems
Date: Mon, 17 Feb 2020 13:23:16 -0500
Message-ID: <9908.1581963796@sss.pgh.pa.us> (raw)
In-Reply-To: <CAFj8pRCLPy1U6W-+hTJMkN-+2NsJ=T8cuu0-+wMrrUXSVUETFg@mail.gmail.com>
References: <HE1P189MB0266B070D1452B04A7C9F6D99D170@HE1P189MB0266.EURP189.PROD.OUTLOOK.COM>
	<eec0413432096c46c96580a7776f13a6f27a9858.camel@cybertec.at>
	<HE1P189MB026658CE70A359C45AB0F64F9D160@HE1P189MB0266.EURP189.PROD.OUTLOOK.COM>
	<61eeb178848bdc2e0dd6c81ce94f3ace7c1348ff.camel@cybertec.at>
	<CAFj8pRCLPy1U6W-+hTJMkN-+2NsJ=T8cuu0-+wMrrUXSVUETFg@mail.gmail.com>

Pavel Stehule <pavel.stehule@gmail.com> writes:
> po 17. 2. 2020 v 17:36 odesílatel Laurenz Albe <laurenz.albe@cybertec.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





view thread (13+ messages)  latest in thread

Message-ID: <9908.1581963796@sss.pgh.pa.us>
Permalink:  ../9908.1581963796@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/9908.1581963796@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pavel.stehule@gmail.com, laurenz.albe@cybertec.at, Lars.Opsahl@nibio.no, pgsql-performance@lists.postgresql.org
  Subject: Re: SubtransControlLock and performance problems
  In-Reply-To: <9908.1581963796@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox