I have a function which is calling three more functions serially in it. Each function is taking 6 seconds of time to complete, so the main function is taking 18secs to complete. I want to optimize this process. instead of calling serially, is there any way to call all 3 functions one at a time?
Main function is written like this
create or replace function main_fun () return varchar2
as
a varchar2(2000);
b varchar2(2000);
c varchar2(2000);
begin
a := func1(); -- this is taking 6 sec to complete
b:= func2(); -- this is taking 6 sec to complete
c := func3(); -- this is taking 6 sec to complete
return (a||B||C);
end;
I have tried like below, but still, main function is taking 18 secs. It seems like though I'm calling all functions in one sql statement, Oracle executing each function one by one
begin
select func1(),func2(),func3()
into a, b, c
from dual;
return (a||B||C);
end;
we are using 12c Oracle DB