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.
Aviso importante
Los códigos y ejemplos proporcionados en WeAreCAS.eu son con fines educativos. Es imperativo no copiarlos y pegarlos ciegamente en sus entornos de producción. El mejor enfoque es comprender la lógica antes de aplicarla. Recomendamos encarecidamente probar estos scripts en un entorno de prueba (Sandbox/Dev). WeAreCAS no acepta ninguna responsabilidad por cualquier impacto o pérdida de datos en sus sistemas.
SAS y todos los demás nombres de productos o servicios de SAS Institute Inc. son marcas registradas o marcas comerciales de SAS Institute Inc. en los EE. UU. y otros países. ® indica registro en los EE. UU. WeAreCAS es un sitio comunitario independiente y no está afiliado a SAS Institute Inc.
Este sitio utiliza cookies técnicas y analíticas para mejorar su experiencia.
Saber más.