Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Pipelined function - Result caching

partlycloudyApr 30 2019 — edited May 3 2019

Oracle 18.1

I have a pipelined PL/SQL function (pipe_fn) which takes a single numeric parameter and returns a collection type with multiple columns, as described here.

Given the same input parameter, the output is the same i.e. the function is deterministic.

I read Tim's excellent article on this but it doesn't quite answer my question.

The function is used in a SQL query of the form

select

...

from large_table lt

join table(pipe_fn(lt.id)) pf onĀ  pf.id = lt.id

I verified that the function executes for each row in large_table (using a sequence nextval in the function code)

How can I reduce the function executions to only the first occurence of LT.ID and use some sort of cache for the others?

Or am I thinking about this wrong? Any ideas appreciated.

Thanks

Comments
Post Details
Added on Apr 30 2019
14 comments
1,325 views