plpgsql: penalty due to double evaluation of parameters - Mailing list pgsql-hackers

From Nikhils
Subject plpgsql: penalty due to double evaluation of parameters
Date
Msg-id d3c4af540805200332x4631a489n857ddd25fa6abe3c@mail.gmail.com
Whole thread Raw
Responses Re: plpgsql: penalty due to double evaluation of parameters  ("Heikki Linnakangas" <heikki@enterprisedb.com>)
List pgsql-hackers
Hi, <br /><br />Within exec_prepare_plan there are calls to exec_eval_datum to identify the argtypes of the involved
parameters.However exec_eval_datum actually fills up value, isnull entries in these cases causing unnecessary
additionalcalls when all we need is the datum type. Such unnecessary evaluation of values might prove to be very costly
latersince this quirk of exec_eval_datum usage is not so visible. Worse still it could cause bugs if some evaluations
haveside-effects across multiple evals. It might make sense to introduce a new function exec_eval_datum_type to address
thisor exec_eval_datum could itself be modified for cases where we just need the datum type. Should I cook up a patch
forthis? I am inclined towards introducing a new function (but that means that any new datum related changes need to be
carriedout in 2 functions instead of one currently).<br clear="all" /><br />Regards,<br />Nikhils<br />-- <br
/>EnterpriseDB              <a href="http://www.enterprisedb.com">http://www.enterprisedb.com</a> 

pgsql-hackers by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: triggers on prepare, commit, rollback... ?
Next
From: Sam Mason
Date:
Subject: Re: triggers on prepare, commit, rollback... ?