From: Philip Semanchuk <philip@americanefficient.com>
To: Joel Jacobson <joel@compiler.org>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: Avoid excessive inlining?
Date: Mon, 21 Dec 2020 11:45:41 -0500
Message-ID: <F3C88129-A382-48E9-AB24-BECDADB8DBB5@americanefficient.com> (raw)
In-Reply-To: <e70cde40-a7ef-4894-9f1d-453ba13a0ced@www.fastmail.com>
References: <e70cde40-a7ef-4894-9f1d-453ba13a0ced@www.fastmail.com>
> On Dec 19, 2020, at 12:59 AM, Joel Jacobson <joel@compiler.org> wrote:
>
> Is there a way to avoid excessive inlining when writing pure SQL functions, without having to use PL/pgSQL?
Hi Joel,
The rules for inlining are here:
https://wiki.postgresql.org/wiki/Inlining_of_SQL_functions
According to those rules, if you declared your SQL function as VOLATILE, then Postgres wouldn’t inline it. From your question, I’m not sure if you want to have the same function inlined sometimes and not others. I can’t think of a way to do that offhand.
Hope this helps,
Philip
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: philip@americanefficient.com, joel@compiler.org
Subject: Re: Avoid excessive inlining?
In-Reply-To: <F3C88129-A382-48E9-AB24-BECDADB8DBB5@americanefficient.com>
References: <e70cde40-a7ef-4894-9f1d-453ba13a0ced@www.fastmail.com> <F3C88129-A382-48E9-AB24-BECDADB8DBB5@americanefficient.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox