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 KNEWFurthermore, “offloadable” functions can also impose large performance penalties. Here’s a verysimple example showing the negative effect of an offloadable function in a WHERE clause:SYS@SANDBOX1> select count(*) from kso.skew3 where col2='KSO';COUNT(*)----------9Elapsed: 00:00:00.13SYS@SANDBOX1> select count(*) from kso.skew3 where upper(col2)='KSO';COUNT(*)----------9Elapsed: 00:00:13.16SYS@SANDBOX1> @fsx4Enter value for sql_text: select count(*) from kso.skew3 where%KSO%Enter value for sql_id:SQL_ID CHILD OFFLOAD IO_SAVED_% AVG_ETIME SQL_TEXT--------------------------------------------------------------------------------------0u8gnxmm7cbdk 0 Yes 100.00 .12 select count(*) from kso.skew3 where col37t7fzkajz2fc 0 Yes 99.99 13.16 select count(*) from kso.skew3 where uppElapsed: 00:00:00.08So UPPER is an offloadable function. Yet when we used it in the WHERE clause of this particularstatement, the result was a large degradation in performance. If you’ve been following along on-screen,you may already have a pretty good idea why.SYS@SANDBOX1> select name, value from v$mystat s, v$statname n2 where n.statistic# = s.statistic#3 and name like '%storage%';NAMEVALUE--------------------------------------------------------------------------------cell physical IO bytes saved by storage index 0SYS@SANDBOX1> set timing onSYS@SANDBOX1> select count(*) from kso.skew3 where upper(col2)='KSO';517

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

Saved successfully!

Ooh no, something went wrong!