Re: inlining SQL functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jim Nasby <decibel(at)decibel(dot)org>
Cc: Alexey Klyukin <alexk(at)commandprompt(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: inlining SQL functions
Date: 2010-04-25 19:13:06
Message-ID: 7290.1272222786@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jim Nasby <decibel(at)decibel(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2010-04-25 21:29:47 Re: global temporary tables
Previous Message Simon Riggs 2010-04-25 19:07:28 Re: testing HS/SR - 1 vs 2 performance