Re: inlining SQL functions - Mailing list pgsql-hackers

From Tom Lane
Subject Re: inlining SQL functions
Date
Msg-id 7290.1272222786@sss.pgh.pa.us
Whole thread Raw
In response to Re: inlining SQL functions  (Jim Nasby <decibel@decibel.org>)
Responses Re: inlining SQL functions  (Jim Nasby <decibel@decibel.org>)
List pgsql-hackers
Jim Nasby <decibel@decibel.org> writes:
> On Apr 2, 2010, at 12:12 PM, Tom Lane wrote:
>> If you're thinking of just replacing the call with a sub-SELECT
>> construct, that's no good in general because it would change the
>> semantics.

> Since Alexey was working on this for us, I'll elaborate. The actual
> use case is below.

There are two reasons why that function doesn't get inlined: it's not
declared to return SETOF, and it's (implicitly) declared VOLATILE.
If you make it SETOF and STABLE, it'll get inlined.  Both of those
things change the semantics, so it's hard to do inlining otherwise.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: testing HS/SR - 1 vs 2 performance
Next
From: Josh Berkus
Date:
Subject: Re: global temporary tables