Re: Inline non-SQL SRFs using SupportRequestSimplify - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Inline non-SQL SRFs using SupportRequestSimplify
Date
Msg-id 440458.1763858681@sss.pgh.pa.us
Whole thread Raw
In response to Re: Inline non-SQL SRFs using SupportRequestSimplify  (Paul A Jungwirth <pj@illuminatedcomputing.com>)
List pgsql-hackers
Paul A Jungwirth <pj@illuminatedcomputing.com> writes:
> The reason for supporting more than SQL functions is to let you
> construct the query dynamically, e.g. with user-supplied table/column
> names, or to only include some expensive filters if needed. This would
> be great for building functions that implement temporal
> outer/semi/antijoin. Another use-case I personally have, which I think
> is quite common, is building "parameterized views" for permissions
> checks, e.g. visible_sales(user). In that case we may only need to
> include certain joins if the user belongs to certain roles (e.g. a
> third-party sales rep).

I went through this again, and committed it with a bunch of
mostly-cosmetic changes.  In particular, it seemed like talking
about inlining "set-returning functions" is no longer really on-point,
since this mechanism is perfectly capable of inlining non-SRFs.
(The reason we haven't done that for SQL functions is mainly that
we didn't feel like doing the analysis necessary to prove that a
SELECT will return exactly one row, which would be necessary to
maintain semantic equivalence for a non-SRF after inlining.
The easy cases of that, such as "SELECT expression", are already
sufficiently handled by regular inlining.)

So after some thought I renamed inline_set_returning_function to
inline_function_in_from, and made a bunch of other changes in names
and comments to line up with that.

Thanks for working on this!  I know it's been a long slog.

            regards, tom lane



pgsql-hackers by date:

Previous
From: "Dian Fay"
Date:
Subject: Re: pg_plan_advice
Next
From: * Neustradamus *
Date:
Subject: Re: RFC 9266: Channel Bindings for TLS 1.3 support