BTEQ Parallel Execution to speed up executing SQL statements

Tools

BTEQ Parallel Execution to speed up executing SQL statements

Currently I am executing SQL statements one by one as below,

bteq << EOB
.logon XXXX
.OS rm -f file.sql
.SET FORMAT OFF
.SET TITLEDASHES OFF
.SET WIDTH 999
.export data file=file.sql
.SET RECORDMODE OFF;

SQL statement1;
SQL statement2;
SQL statement3;
SQL statement4;
SQL statement5;
SQL statement6;
SQL statement7;
SQL statement8;
SQL statement9;
SQL statement10;

.export reset
.EXIT ERRORCODE
EOB

and it is taking more time.

Is there any way we can speed up the execution by making the execution process parallel in BTEQ.

3 REPLIES

Re: BTEQ Parallel Execution to speed up executing SQL statements

You can try as below set more sessions and as a multi statment request -

.set sessions 8;

SQL statement1

;SQL statement2

;SQL statement3

;SQL statement4

...etc
;SQL statement10

Re: BTEQ Parallel Execution to speed up executing SQL statements

@SriLaxmi, I do not think this will make the sql's run in parallel. instead it will increse the number of sessions connecting to Teradata and will execute each query faster.

@Muthu: Are the sql's interdependant like the output of the preceding query becomes the input for the current query etc.. If not then create multiple BTEQ scripts with single sqls and you can call all of them in a Shell script in parallel.

Re: BTEQ Parallel Execution to speed up executing SQL statements

Hi Krishna,  increasing the sessions would make the time lesser which is the objective. 

And can you clarify if the sqls are not dependet and written in MSR fashion (semicolon before the next sql)  it would execute all the SQLs in parallel in the same transient journal. (yes we need see if should fall under spool errros)

--Sri