Quantcast
Channel: SCN: Message List - SAP HANA and In-Memory Computing
Viewing all articles
Browse latest Browse all 8968

Re: How to run HANA Stored procedure in parallel

$
0
0

The short version is: don't use cursors. They will never run in parallel. You can rewrite your stored procedure to avoid them in most cases.

 

If you truly believe you can't avoid cursors then you can do the following:

 

- Select all stores into a local table variable with M values

- Unnest it into an array

- Create N arrays where N is the degree of parallelism

- Loop through array M and alternately insert into arrays N

- Call a subprocedure that does your logic, N times

 

This will cause your job to run with a degree of parallelism of N. But, if you end up doing this way, you could probably have rewritten the stored procedure to avoid the use of cursors in the first place.

 

John


Viewing all articles
Browse latest Browse all 8968

Trending Articles



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