Enable the trace options to see the SQL generated by the LIBNAME engine:
options sastrace=',,,d' sastraceloc=SASLOG;
1
options sastrace=',,,d' sastraceloc=SASLOG;
If you see a complex SQL query with your JOINs and WHERE clauses in the log: The LIBNAME engine is working well (Implicit Pass-Through successful). The problem may be missing indexes on the database side.
Disadvantage: You lose portability (the code becomes specific to Oracle/SQL Server/etc.).
proc sql;
connect to oracle (user=... password=... path=...);
create table want as
select * from connection to oracle
(
SELECT A.id, B.value
FROM tableA A
INNER JOIN tableB B ON A.id = B.id
/* Ce code est exécuté par Oracle, pas SAS */
);
disconnect from oracle;
quit;
1
PROC SQL;
2
connect to oracle (user=... password=... path=...);
There's no magic, only comparative tests (FULLSTIMER) in your specific environment.
To optimize your massive joins:
Audit first with SASTRACE to see if LIBNAME is doing its job.
Test explicit Pass-Through if implicit fails.
Don't rule out the option of bringing back subsets of data to do a local MERGE if the database server is overloaded.
Important Disclaimer
The codes and examples provided on WeAreCAS.eu are for educational purposes. It is imperative not to blindly copy-paste them into your production environments. The best approach is to understand the logic before applying it. We strongly recommend testing these scripts in a test environment (Sandbox/Dev). WeAreCAS accepts no responsibility for any impact or data loss on your systems.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.