Quantcast
Channel: SCN: Message List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 9165

Parallel execution of user defined functions and procedures

$
0
0

Hi experts,

 

I'm trying to get a grip on HANAs parallelisation features. For that I'm using a procedure and a wrapper function to call that procedure in a SQL statement like this

 

select "MJA"."testfunc"(row_num) from "MJA"."TBL_KEYS";

 

The procedure is definied like this:

 

create PROCEDURE "MJA"."zmja_proc" ( IN i_row_num BIGINT, OUT result VARCHAR(4096)) LANGUAGE SQLSCRIPT READS SQL data AS BEGIN

  starttime = SELECT CURRENT_TIMESTAMP as ts FROM DUMMY;        

  result = :starttime.ts[1];

END;

 

And this is the wrapper function for this procedure:

 

CREATE FUNCTION "MJA"."testfunc"(row_num BIGINT) RETURNS result varchar(4096) LANGUAGE SQLSCRIPT READS SQL DATA AS

BEGIN

  CALL "MJA"."zmja_proc"( row_num, result ) ;

END;

 

So my thinking is that for all entries in the tbl_keys table the testfunc function is called with the contents of the column "ROW_NUM". Then the function calls the procedure which in return gives back some value it fetches via SQL. It works all well but checking the execution with the viz plan I see that the procedure  is not called in parallel but serial.

 

Viz Plan.PNG

 

So, my question is, how can I force a parallel execution of the procedure. I dont see any reason why HANA shouldn't be able to understand that it in fact could run those calculations in parallel as they are completely independend of each other...

 

Thanks in advance, Marcel


Viewing all articles
Browse latest Browse all 9165

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>