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

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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