10.07.2015 Views

Expert Oracle Exadata - Parent Directory

Expert Oracle Exadata - Parent Directory

Expert Oracle Exadata - Parent Directory

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.

CHAPTER 16 UNLEARNING SOME THINGS WE THOUGHT WE KNEWSYS@SANDBOX1> alter session set cell_offload_processing=true;Session altered.Elapsed: 00:00:00.00SYS@SANDBOX1> alter session set "_serial_direct_read"=true;Session altered.Elapsed: 00:00:00.00SYS@SANDBOX1>-- With Smart ScansSYS@SANDBOX1> select /*+ full(a) */ count(*) from kso.skew a where col1 =1;COUNT(*)----------3199971Elapsed: 00:00:01.06SYS@SANDBOX1> select /*+ full(a) */ count(*) from kso.skew a where col1 = 999999;COUNT(*)----------32Elapsed: 00:00:00.08SYS@SANDBOX1> select sum(case when col1 = 1 then 1 else 0 end) how_many_ones,2 sum(case when col1 = 999999 then 1 else 0 end) how_many_nines3 from kso.skew;HOW_MANY_ONES HOW_MANY_NINES---------------------------3199971 32Elapsed: 00:00:04.33Offloading completely reverses the results. The total elapsed time to run the two individualstatements (1.14 seconds) is about 25% of the time required to complete the combined statement (4.33seconds). Notice also that the combined statement runs in a quarter of the time it took withoutoffloading, but the individual statements completed in roughly one-tenth the time that was requiredwithout offloading. The combined statement was not as effective as the individual statements, since theCASE statement causes each record in the table to be returned to the database server for evaluation. Sowhile the statement does benefit from column projection, it does not benefit from predicate filtering orstorage indexes. Just to be clear, CASE statements don’t disable Smart Scans, but they are often used in away that reduces their effectiveness by eliminating the opportunity to filter rows at the storage layer.525

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

Saved successfully!

Ooh no, something went wrong!