Re: plpgsql: penalty due to double evaluation of parameters

From: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>
To: "Nikhils" <nikkhils(at)gmail(dot)com>
Cc: "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>, <rushabh(dot)lathia(at)gmail(dot)com>
Subject: Re: plpgsql: penalty due to double evaluation of parameters
Date: 2008-05-21 12:24:46
Message-ID: 4834148E.7030800@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2008-05-21 12:25:29 Re: WITH RECURSIVE patch V0.1
Previous Message Merlin Moncure 2008-05-21 12:11:37 Re: idea: storing view source in system catalogs