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.

51CHAPTER6Threaded ReadsOverview of Threaded Reads in <strong>SAS</strong>/<strong>ACCESS</strong> 51Underlying Technology of Threaded Reads 51<strong>SAS</strong>/<strong>ACCESS</strong> Interfaces and Threaded Reads 52Scope of Threaded Reads 52Options That Affect Threaded Reads 53Generating Trace In<strong>for</strong>mation <strong>for</strong> Threaded Reads 54Per<strong>for</strong>mance Impact of Threaded Reads 57Autopartitioning Techniques in <strong>SAS</strong>/<strong>ACCESS</strong> 57Data Ordering in <strong>SAS</strong>/<strong>ACCESS</strong> 58Two-Pass Processing <strong>for</strong> <strong>SAS</strong> Threaded Applications 58When Threaded Reads Do Not Occur 59Summary of Threaded Reads 59Overview of Threaded Reads in <strong>SAS</strong>/<strong>ACCESS</strong>In <strong>SAS</strong> 8 and earlier, <strong>SAS</strong> opened a single connection to the DBMS to read a table.<strong>SAS</strong> statements requesting data were converted to an SQL statement and passed to theDBMS. The DBMS processed the SQL statement, produced a result set consisting oftable rows and columns, and transferred the result set back to <strong>SAS</strong> on the singleconnection.With a threaded read, you can reduce the table read time by retrieving the result seton multiple connections between <strong>SAS</strong> and the DBMS. <strong>SAS</strong> can create multiple threads,and a read connection is established between the DBMS and each <strong>SAS</strong> thread. Theresult set is partitioned across the connections, and rows are passed to <strong>SAS</strong>simultaneously (in parallel) across the connections, which improves per<strong>for</strong>mance.Underlying Technology of Threaded ReadsTo per<strong>for</strong>m a threaded read, <strong>SAS</strong> first creates threads within the <strong>SAS</strong> session.Threads are standard operating system tasks that <strong>SAS</strong> controls. <strong>SAS</strong> then establishes aDBMS connection on each thread, causes the DBMS to partition the result set, andreads one partition per thread. To cause the partitioning, <strong>SAS</strong> appends a WHEREclause to the SQL so that a single SQL statement becomes multiple SQL statements,one <strong>for</strong> each thread. Here is an example.

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

Saved successfully!

Ooh no, something went wrong!