From: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Improve performance of repeated CALLs within plpgsql procedures.
Date: Tue, 26 Jan 2021 19:54:46 +0900
Message-ID: <YA/09gVged25bRsI@paquier.xyz> (raw)
In-Reply-To: <E1l4F1z-0000cN-Lx@gemulon.postgresql.org>
References: <E1l4F1z-0000cN-Lx@gemulon.postgresql.org>
Hi Tom,
On Tue, Jan 26, 2021 at 03:28:39AM +0000, Tom Lane wrote:
> Improve performance of repeated CALLs within plpgsql procedures.
>
> This patch essentially is cleaning up technical debt left behind
> by the original implementation of plpgsql procedures, particularly
> commit d92bc83c4. That patch (or more precisely, follow-on patches
> fixing its worst bugs) forced us to re-plan CALL and DO statements
> each time through, if we're in a non-atomic context. That wasn't
> for any fundamental reason, but just because use of a saved plan
> requires having a ResourceOwner to hold a reference count for the
> plan, and we had no suitable resowner at hand, nor would the
> available APIs support using one if we did. While it's not that
> expensive to create a "plan" for CALL/DO, the cycles do add up
> in repeated executions.
lapwing is generating a warning here:
https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?nm=lapwing&dt=2021-01-26%2010%3A40%3A...
pl_handler.c: In function 'plpgsql_call_handler':
pl_handler.c:303:2: error: 'retval' may be used uninitialized in this
function [-Werror=maybe-uninitialized]
pl_handler.c:228:8: note: 'retval' was declared here
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: michael@paquier.xyz, tgl@sss.pgh.pa.us
Subject: Re: pgsql: Improve performance of repeated CALLs within plpgsql procedures.
In-Reply-To: <YA/09gVged25bRsI@paquier.xyz>
References: <E1l4F1z-0000cN-Lx@gemulon.postgresql.org> <YA/09gVged25bRsI@paquier.xyz>
* 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