Re: performance of sql and plpgsql functions

From: Philip Semanchuk <philip(at)americanefficient(dot)com>
To: Julius Tuskenis <julius(dot)tuskenis(at)gmail(dot)com>
Cc: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: performance of sql and plpgsql functions
Date: 2024-06-17 12:59:07
Message-ID: 460C0856-62C7-44B5-BEFE-2E9FD4E4F0DE@americanefficient.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

> On Jun 17, 2024, at 5:35 AM, Julius Tuskenis <julius(dot)tuskenis(at)gmail(dot)com> wrote:
>
>
> Isn't PosgreSQL supposed to inline simple SQL functions that are stable or immutable?

Postgres inlines SQL functions under certain conditions:
https://wiki.postgresql.org/wiki/Inlining_of_SQL_functions

One of those conditions is "the function is not SECURITY DEFINER”. It looks like yours is defined that way, so that might be why it’s not being inlined.

Hope this helps
Philip

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Julius Tuskenis 2024-06-17 13:54:48 Re: performance of sql and plpgsql functions
Previous Message Julius Tuskenis 2024-06-17 11:01:00 Re: performance of sql and plpgsql functions