On Tuesday 08 Jul 2003 7:48 pm, Tom Lane wrote:
> Richard Huxton <[EMAIL PROTECTED]> writes:
> > Can I ask why, since the plan is constructed at query-time the parameters
> > aren't substitued *before* planning?
>
> Because then the plan couldn't be re-used. A SQL function may be
> executed many t
Richard Huxton <[EMAIL PROTECTED]> writes:
> Can I ask why, since the plan is constructed at query-time the parameters
> aren't substitued *before* planning?
Because then the plan couldn't be re-used. A SQL function may be
executed many times in a query, so the plan has to be reusable.
(Or, if y
I define an SQL function:
CREATE FUNCTION foo(timestamptz) AS '
...' LANGUAGE 'SQL';
Does the plan for the body get built at creation or execution time? I could
have sworn it was execution time, but timings on one function suggest
creation?
For those new to functions, plpgsql always prepares i