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 ---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match