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 2 OFFLOADING / SMART SCANAVG(PK_COL)-----------1849142.5Elapsed: 00:00:49.68SYS@SANDBOX1> @fsx4Enter value for sql_text: select avg(pk_col) from kso.skew3 where col1 < 0Enter value for sql_id:SQL_ID CHILD OFFLOAD IO_SAVED_% AVG_ETIME SQL_TEXT------------- ------ ------- ---------- ---------- ---------------------------------a6j7wgqf84jvg 0 Yes 100.00 .07 select avg(pk_col) from kso.skew3a6j7wgqf84jvg 1 No .00 49.68 select avg(pk_col) from kso.skew3Elapsed: 00:00:00.04In the fsx script you can see that the OFFLOAD column is just a DECODE that checks to see if theIO_CELL_OFFLOAD_ELIGIBLE_BYTES column is equal to 0 or not. The IO_SAVED_% column is calculated usingthe IO_INTERCONNECT_BYTES field, and it attempts to show how much data was returned to the databaseservers. The example shows the same statement run once with Smart Scan enabled and once with SmartScan disabled. We used the CELL_OFFLOAD_PROCESSING parameter to turn Smart Scans on and off for thispurpose. Changing this parameter caused the original cursor to be invalidated because of an optimizermismatch. This resulted in two child cursors for the statement. In our example, the output of the scriptshows that one version of the statement was offloaded using Smart Scans and took less than a second.The second execution of the statement though was not Offloaded and took almost a minute.The technique used by the fsx script seems to work pretty well most of the time. However, insituations where a single child cursor is used repeatedly, it is possible that some executions may beexecuted using Smart Scans while others are not. While this is an unusual situation, it can causeconfusion because the IO_CELL_OFFLOAD_ELIGIBLE_BYTES column contains a cumulative value for allexecutions. That is to say that each execution adds its eligible bytes count to the running total. Whensome executions use Smart Scans and some don’t, the IO_CELL_OFFLOAD_ELIGIBLE_BYTES column will begreater than 0. This is a fairly rare occurrence and you may never run into it. Nevertheless, here is anexample:SYS@SANDBOX1> alter session set "_serial_direct_read"=true;Session altered.Elapsed: 00:00:00.01SYS@SANDBOX1> -- execution 1SYS@SANDBOX1> select avg(pk_col) from kso.skew a where col1 > 0;AVG(PK_COL)-----------16093748.81 row selected.Elapsed: 00:00:03.51SYS@SANDBOX1> @fsx3Enter value for sql_text: %skew%Enter value for sql_id:56

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

Saved successfully!

Ooh no, something went wrong!