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.
Wichtiger Haftungsausschluss
Die auf WeAreCAS.eu bereitgestellten Codes und Beispiele dienen Lehrzwecken. Es ist zwingend erforderlich, sie nicht blind in Ihre Produktionsumgebungen zu kopieren. Der beste Ansatz besteht darin, die Logik zu verstehen, bevor sie angewendet wird. Wir empfehlen dringend, diese Skripte in einer Testumgebung (Sandbox/Dev) zu testen. WeAreCAS übernimmt keine Verantwortung für mögliche Auswirkungen oder Datenverluste auf Ihren Systemen.
SAS und alle anderen Produkt- oder Dienstleistungsnamen von SAS Institute Inc. sind eingetragene Marken oder Marken von SAS Institute Inc. in den USA und anderen Ländern. ® zeigt die Registrierung in den USA an. WeAreCAS ist eine unabhängige Community-Site und nicht mit SAS Institute Inc. verbunden.
Diese Website verwendet technische und analytische Cookies, um Ihre Erfahrung zu verbessern.
Mehr erfahren.