Re: Alternative to slow SRF in SELECT? - Mailing list pgsql-general

From David G. Johnston
Subject Re: Alternative to slow SRF in SELECT?
Date
Msg-id CAKFQuwY=jQLdnv4LtAm8hDdJTnQPjT55iWNcjUmrNu1pEY_ZHw@mail.gmail.com
Whole thread Raw
In response to Alternative to slow SRF in SELECT?  (Markur Sens <markursens@gmail.com>)
List pgsql-general
On Tue, May 17, 2022 at 7:19 AM Markur Sens <markursens@gmail.com> wrote:
I have the following  case

select 
my_srf_func(otherfunc(h))
from (values (‘…’::mytype),

         as temp(h);



Any alternatives on how I could rework the query or the my_srf_func to speed things up, without having too many subqueries?


Placing the SRF function in the target list is now largely deprecated.  Table producing functions belong in the FROM clause.  The introduction of LATERAL joins made this possible.  My preference is to retain the JOIN syntax.

SELECT *
FROM (...) AS temp (h)
JOIN my_srf_func(h) ON true

David J.

pgsql-general by date:

Previous
From: Markur Sens
Date:
Subject: Alternative to slow SRF in SELECT?
Next
From: "David G. Johnston"
Date:
Subject: Re: Restricting user to see schema structure