SQL Functions and plan time - Mailing list pgsql-general

From Richard Huxton
Subject SQL Functions and plan time
Date
Msg-id 200307071938.35320.dev@archonet.com
Whole thread Raw
Responses Re: SQL Functions and plan time  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
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 its plan at "compile" time
so doesn't have actual values available to refine its plan.

--
  Richard Huxton

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Datatypes and performance
Next
From: "Clay Luther"
Date:
Subject: www.postgresql.org FUBAR