hi all,
Can anyone please explain to me the advantage of the one over the other or any good article i can read about this?
If i use the 1st i know i can link all the oracle tables to SAS and play with them(update,join,....) and then save them back in Oracle. The 2nd one is kinda annoying to me but i ve seen many times ppl use it more then the 1st one.Why? Memory-wise,CPU wise?
Thanks,
In my view, one of the advantages of using pass-through is that you can be sure that the code, table joins, etc is processed by the DBMS engine.
With libname access, SAS may not be able to pass the code to the DBMS for processing. As a result, expensive table joins may be passed in their entirety back to SAS to handle -- which increases network traffic, table sizes, processing time, etc.
However, libname method can be much easier to work with since you can dispense with having to use DBMS-specific code.
If joins and code are fairly straightforward, and I am fairly confident that SAS will pass the query to the DBMS for processing, then I will use the libname method.
Otherwise, I use pass-through.
In my view, one of the advantages of using pass-through is that you can be sure that the code, table joins, etc is processed by the DBMS engine.
With libname access, SAS may not be able to pass the code to the DBMS for processing. As a result, expensive table joins may be passed in their entirety back to SAS to handle -- which increases network traffic, table sizes, processing time, etc.
However, libname method can be much easier to work with since you can dispense with having to use DBMS-specific code.
If joins and code are fairly straightforward, and I am fairly confident that SAS will pass the query to the DBMS for processing, then I will use the libname method.
Otherwise, I use pass-through.
Thanks for the nice explanation Fugue.
So if i have lets say 2M - 8M record tables i should use pass through ,huh even though the joins are quite straightforward ?
I'd be inclined to agree with you as a general rule -- explicit PROC SQL pass-through would be the superior choice in that case.
In my experience I've found Oracle more fiddly to tune well compared to other databases such as SQL Server. In which case PROC SQL pass-through gives you better control to do things like Oracle hints for parallelisation for example.
Also dont forget other SAS options for tuning database queries. My favourite is READBUFF = this can have a huge impact on query performance, and they work equally well for LIBNAME and pass-through.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.