13.07.2015 Views

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

718 Per<strong>for</strong>mance Summary 4 Chapter 25Per<strong>for</strong>ming a threaded read on this table causes Oracle to make two separateconnections to the Oracle server. <strong>SAS</strong> tracing shows the SQL generated <strong>for</strong> eachconnection:data new;set x.EMPLOYEE(DBSLICPARM=ALL);run;ORACLE: SELECT "EMPNO", "EMPNAME", "HIREDATE", "SALARY", "GENDER"FROM EMPLOYEE WHERE ABS(MOD("EMPNO",2))=0ORACLE: SELECT "EMPNO", "EMPNAME", "HIREDATE", "SALARY", "GENDER"FROM EMPLOYEE WHERE ABS(MOD("EMPNO",2))=1EMPNO, the primary key, is selected as the MOD column.The success of MOD depends on the distribution of the values within the selectedModColumn and the value of N. Ideally, the rows are distributed evenly among thethreads.You can alter the N value by changing the second parameter of DBSLICEPARM=LIBNAME option.Per<strong>for</strong>mance SummaryThere are times you might not see an improvement in per<strong>for</strong>mance with the MODtechnique. It is possible that the engine might not be able to find a column thatqualifies as a good MOD column. In these situations, you can explicitly specifyDBSLICE= data set option to <strong>for</strong>ce a threaded read and improve per<strong>for</strong>mance.It is a good policy to let the engine autopartition and intervene with DBSLICE= onlywhen necessary.Temporary Table Support <strong>for</strong> OracleFor general in<strong>for</strong>mation about this feature, see “Temporary Table Support <strong>for</strong> <strong>SAS</strong>/<strong>ACCESS</strong>” on page 38.Establishing a Temporary TableA temporary table in Oracle persists just like a regular table, but contains eithersession-specific or transaction-specific data. Whether the data is session- ortransaction-specific is determined by what is specified with the ON COMMIT keywordwhen you create the temporary table.In the <strong>SAS</strong> context, you must use the LIBNAME option, CONNECTION=SHARED,be<strong>for</strong>e data in a temporary table persists over procedure and DATA step boundaries.Without this option, the temporary table persists but the data within it does not.For data to persist between explicit SQL pass-through boundaries, you must use theLIBNAME option, CONNECTION=GLOBAL.If you have a <strong>SAS</strong> data set and you want to join it with an Oracle table to generate areport, the join normally occurs in <strong>SAS</strong>. However, using a temporary table you can alsohave the join occur on the Oracle server.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!