Re: 7.4 in-lining of SQL functions - Mailing list pgsql-general

From Tom Lane
Subject Re: 7.4 in-lining of SQL functions
Date
Msg-id 5116.1097816535@sss.pgh.pa.us
Whole thread Raw
In response to 7.4 in-lining of SQL functions  (Mike Mascari <mascarm@mascari.com>)
List pgsql-general
Mike Mascari <mascarm@mascari.com> writes:
> "Simple SQL functions can now be inlined by including their SQL in the
> main query. This improves performance by eliminating per-call overhead.
> That means simple SQL functions now behave like macros."

> has me a bit worried. What does "simple" mean?

Not anything involving UNION :-(

The basic intent of the current inlining facility is to support inlining
of functions that return scalar results.  I think that it punts entirely
for functions that return SETOF anything; it certainly shouldn't be
expected to do amazing feats of query optimization for them...

You would probably have better results using views, if you can express
your problems using views.  Those do get "inlined" pretty well.

            regards, tom lane

pgsql-general by date:

Previous
From: jdolecek@NetBSD.org (Jaromir Dolecek)
Date:
Subject: Re: 'NOW' in UTC with no timezone
Next
From: Michael Glaesemann
Date:
Subject: Re: Has anyone tried Date/Darwen/Lorentzos's model for temporal data?