BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Yen
Calcite | Level 5 Yen
Calcite | Level 5

The below query takes 6 hours to run. Can any one help with tuning?

 

options nocenter compress=yes;
libname lib 'path';

%libkrb5(uwork,teradata,dbname);

proc sql;
%krb5(rchtera);
execute (collect statistics on teradata.table1 index (p1)) by teradata;
execute (collect statistics on teradata.table1 column (p1)) by teradata;
execute (collect statistics on teradata.table2 index (o1)) by teradata;
execute (collect statistics on teradata.table2 column (o1)) by teradata;
create table lib.t1 (bufsize=1073741824 bufno=max) as /*t1 has195395189 rows and 7 columns*/
select * from connection to teradata(
select distinct a.p1
,b.o1
,c.c1
,c.c2
,c.c3
,c.c4
,c.c5
from teradata.table1 a /* has 21371007 rows and 51 columns */
,vbmr.pty_ofr_dtl b
,teradata.table2 c  /* has 198 rows and 9 column */
where a.p1 = b.p1
and b.o1 = c.o1
and b.o2 = '9999-12-31'
and b.o3 = 1
and b.o4 = 0
and b.o5 = 0
);
disconnect from teradata;
quit;

1 ACCEPTED SOLUTION

Accepted Solutions
1 REPLY 1
Kurt_Bremser
Super User
As all this happens in and from Teradata, there's two options:
- the Teradata actions and query take so long
- your network is the bottleneck in fetching the result
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 795 views
  • 0 likes
  • 2 in conversation