Re: pgsql: Improve performance of repeated CALLs within plpgsql procedures. - Mailing list pgsql-committers

From Michael Paquier
Subject Re: pgsql: Improve performance of repeated CALLs within plpgsql procedures.
Date
Msg-id YA/09gVged25bRsI@paquier.xyz
Whole thread Raw
In response to pgsql: Improve performance of repeated CALLs within plpgsql procedures.  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pgsql: Improve performance of repeated CALLs within plpgsql procedures.
List pgsql-committers
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%3A09&stg=make
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

Attachment

pgsql-committers by date:

Previous
From: Michael Paquier
Date:
Subject: pgsql: Fix memory leak when deallocating prepared statement in postgres
Next
From: Tom Lane
Date:
Subject: Re: pgsql: Improve performance of repeated CALLs within plpgsql procedures.