Re: pgsql: Improve performance of repeated CALLs within plpgsql procedures.

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Improve performance of repeated CALLs within plpgsql procedures.
Date: 2021-01-26 10:54:46
Message-ID: YA/09gVged25bRsI@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2021-01-26 15:16:50 Re: pgsql: Improve performance of repeated CALLs within plpgsql procedures.
Previous Message Michael Paquier 2021-01-26 09:43:21 pgsql: Fix memory leak when deallocating prepared statement in postgres