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

From Heikki Linnakangas
Subject Re: plpgsql: penalty due to double evaluation of parameters
Date
Msg-id 4834148E.7030800@enterprisedb.com
Whole thread Raw
In response to plpgsql: penalty due to double evaluation of parameters  (Nikhils <nikkhils@gmail.com>)
Responses Re: plpgsql: penalty due to double evaluation of parameters  (Nikhils <nikkhils@gmail.com>)
Re: plpgsql: penalty due to double evaluation of parameters  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Nikhils wrote:
> 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 additional calls
> when all we need is the datum type. Such unnecessary evaluation of values
> might prove to be very costly later since this quirk of exec_eval_datum
> usage is not so visible. Worse still it could cause bugs if some evaluations
> have side-effects across multiple evals.

I don't buy the performance argument unless I see some test results 
demonstrating it; exec_prepare_plan is only called on the first 
invocation of a statement. What kind of side-effects could 
exec_eval_datum call have?

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: idea: storing view source in system catalogs
Next
From: Tatsuo Ishii
Date:
Subject: Re: [PATCHES] WITH RECURSIVE patch V0.1