run queries in parallel and serial

Analytics
Enthusiast

run queries in parallel and serial

Hello,

I have a question ,

I want to execute three sql statements,sql1 - sql2 -sql3.

I want to run them from bteq.

How can i run sql1 and sql2 in parallel and then sql3?

I tried with cmd,calling seperate files of bteq but nothing.

By ".run file" the same.

By putting the ";" at the next line is just an implicit transaction,no parallel.

how can I manage this situation?

Thank you very much.

5 REPLIES

Re: run queries in parallel and serial

I would also like to know if this is possible. Can anyone help? Thanks.

Enthusiast

Re: run queries in parallel and serial

You can use session or pack factor. You can use Pack factor with repeat  judiciously.

Cheers,

Raja

Senior Apprentice

Re: run queries in parallel and serial

A Multi Statement Request is one transaction, but the optimizer might run the indvidual statements in parallel.

If you want to submit multiple requests in parallel you need multiple sessions, afaik there's no way to do that in BTEQ (multiple sessions can be used, but only a REPEAT will actually utilize them)

Enthusiast

Re: run queries in parallel and serial

In a multistatement request, it is optimizer's decision to either execute the steps in serial or in parallel. 

If your requests are indepedent of each other you can use explain to see how optimizer plans to execute your requests.

Khurram
Enthusiast

Re: run queries in parallel and serial

Try with run files to achieve your goal, controlling with session, pack factor and repeat. Bteq  anyway allows max of 200 sessions and if I remember correctly, we can't change sessions between logon and logoff and share  your learning :).

Cheers,

Raja