Re: SQL Functions and plan time

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Richard Huxton <dev(at)archonet(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: SQL Functions and plan time
Date: 2003-07-08 18:48:11
Message-ID: 25631.1057690091@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Richard Huxton <dev(at)archonet(dot)com> 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 you prefer, we have query-level caching of SQL function plans.)

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Maksim Likharev 2003-07-08 18:57:18 Re: PG crash on simple query, story continues
Previous Message Tom Lane 2003-07-08 18:44:53 Re: PG crash on simple query, story continues