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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

58 Data Ordering in <strong>SAS</strong>/<strong>ACCESS</strong> 4 Chapter 6andSELECT CHR1, CHR2 FROM DBTAB WHERE (MOD(INTCOL,2)=0)SELECT CHR1, CHR2 FROM DBTAB WHERE (MOD(INTCOL,2)=1)Rows with an even value <strong>for</strong> IntCol are retrieved by the first thread. Rows with an oddvalue <strong>for</strong> IntCol are retrieved by the second thread. Distribution of rows across the twothreads is optimal if IntCol has a 50/50 distribution of even and odd values.<strong>SAS</strong> modifies the SQL <strong>for</strong> columns containing negative integers, <strong>for</strong> nullablecolumns, and to combine <strong>SAS</strong> WHERE clauses with the partitioning WHERE clauses.<strong>SAS</strong> can also run more than two threads. You use the second parameter of theDBSLICEPARM= option to increase the number of threads.The success of this technique depends on the distribution of the values in the chosenintegral column. Without knowledge of the distribution, your <strong>SAS</strong>/<strong>ACCESS</strong> productattempts to pick the best possible column. For example, indexed columns are givenpreference <strong>for</strong> some DBMSs. However, column selection is more or less a guess, and the<strong>SAS</strong> guess might cause poor distribution of the result set across the threads. If nosuitable numeric column is found, MOD cannot be used at all, and threaded reads willnot occur if your <strong>SAS</strong>/<strong>ACCESS</strong> product has no other partitioning technique. For thesereasons, you should explore autopartitioning particulars <strong>for</strong> your DBMS and judiciouslyuse DBSLICE= to augment autopartitioning. See the in<strong>for</strong>mation <strong>for</strong> your DBMS <strong>for</strong>specific autopartitioning details.3 Aster nCluster3 DB2 Under UNIX and PC Hosts3 DB2 Under z/OS3 Greenplum3 HP Neoview3 In<strong>for</strong>mix3 ODBC3 Oracle (not supported under z/OS)3 Sybase3 Sybase IQ3 Teradata (supports only FastExport threaded reads on z/OS and UNIX; seeTeradata documentation <strong>for</strong> details)Data Ordering in <strong>SAS</strong>/<strong>ACCESS</strong>The order in which table rows are delivered to <strong>SAS</strong> varies each time a step is rerunwith threaded reads. Most DBMS editions, especially increasingly popular paralleleditions, do not guarantee consistent ordering.Two-Pass Processing <strong>for</strong> <strong>SAS</strong> Threaded ApplicationsTwo-pass processing occurs when a <strong>SAS</strong> Teradata requests that data be madeavailable <strong>for</strong> multiple pass reading (that is, more than one pass through the data set).In the context of DBMS engines, this requires that as the data is read from thedatabase, temporary spool files are written containing the read data. There is onetemporary spool file per thread, and each spool file will contain all data read on that

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

Saved successfully!

Ooh no, something went wrong!