Re: Avoid excessive inlining?

From: Philip Semanchuk <philip(at)americanefficient(dot)com>
To: Joel Jacobson <joel(at)compiler(dot)org>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Avoid excessive inlining?
Date: 2020-12-21 16:45:41
Message-ID: F3C88129-A382-48E9-AB24-BECDADB8DBB5@americanefficient.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On Dec 19, 2020, at 12:59 AM, Joel Jacobson <joel(at)compiler(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andres Freund 2020-12-21 17:42:47 Re: [PATCH] Logical decoding of TRUNCATE
Previous Message Daniele Varrazzo 2020-12-21 14:56:41 psycopg3: prepared statements