SQL Functions and plan time

From: Richard Huxton <dev(at)archonet(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: SQL Functions and plan time
Date: 2003-07-07 18:38:35
Message-ID: 200307071938.35320.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mat 2003-07-07 18:56:44 Transaction Blocks
Previous Message Dmitry Tkach 2003-07-07 18:18:55 Backwards index scan