cancel
Showing results for 
Search instead for 
Did you mean: 

Parallel SQL execution inside Procedure

Former Member
0 Kudos

HI All,

I have multiple, independent sql statements need to be executed inside a procedure.

How can I make sure they run parallel.

Presently I am running them sequentially like

EXECUTE (:QUERY1);

EXECUTE (:QUERY2);

EXECUTE(:QUERY3);

Regards,

Suman.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Suman,

What if I place these insert statements in different procedures and call them sequentially in a master procedure ? Will they still run sequentially ?

Nope.They will still run Sequentially.

Are there any ways to run parallel insert statements in HANA?

One way you do this, use Data services and schedule them as different Jobs.

Regards

PK

former_member182114
Active Contributor
0 Kudos

Hi Suman,

Is this EXECUTE a call to dynamic statments?

They are dynamic and this is one think that force sequential execution.

Do you really need it dynamic?

Regards, Fernando Da Rós

Former Member
0 Kudos

Hi Fernandos,

It doesn't need to be dynamic statements.

Assume they are static sql statements with out EXECUTE. How can I make them run parallel.

Regards,

Suman

former_member182114
Active Contributor
0 Kudos

Hi Suman,

They automatic run in parallel.

Somethings that avoid the parallelism:

- your procedure is read write

- use of imperative code (IF, LOOP's,)

- dependencies between EXEC1, EXEC2, EXEC3

If your code isn't running in parallel and you don't know the cause, please post it here so we can guess about it.

Regards, Fernando Da Rós

Former Member
0 Kudos

Thank you Fernandos,

I don't have any imperative code and dependencies.

Just a few independent  insert statement. I am not sure whether they are running parallel or not.

How do I know these statements are running parallel ?

Regards,

Suman

former_member182114
Active Contributor
0 Kudos

Suman Karanam wrote:

Just a few independent  insert statement.

It's not. Read write operations is one thing that makes it run sequential.

Regards, Fernando Da Rós

Former Member
0 Kudos

That's sad.

What if I place these insert statements in different procedures and call them sequentially in a master procedure ? Will they still run sequentially ?

Are there any ways to run parallel insert statements in HANA?

Thanks for your time and replies !

Regards,

Suman

former_member182114
Active Contributor
0 Kudos

Hi Suman,

A procedure read-write can be called only by read-write procedure, so inside a procedure you don't have a chance to do it in parallel.

You need to review your solution, may you have options to do a single statment insertion or do not insert but do in selection...  Sorry but it's everything I can say with information that you provided which (not too much in fact).

Best regards, Fernando Da Rós