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 4 STORAGE INDEXESElapsed: 00:00:00.01SYS@EXDB1> select count(*) from kso.skew3 where col3 = '20-OCT-2005';COUNT(*)----------0Elapsed: 00:00:00.07SYS@EXDB1> @siNAMEVALUE--------------------------------------------- ---------------cell physical IO bytes saved by storage index 15954337792Elapsed: 00:00:00.01In this very simple example there is a query with a predicate comparing a date column (col3) to astring containing a date. In one case, the string contained a four-digit year. In the other, only two digitswere used. Only the query with the four-digit year format used the Storage Index. Let’s look at the plansfor the statements to see why the two queries were treated differently:SYS@EXDB1> @fsx2Enter value for sql_text: select count(*) from kso.skew3 where col3 = %Enter value for sql_id:Enter value for inst_id:SQL_IDAVG_ETIME PX OFFLOAD IO_SAVED% SQL_TEXT------------- ------------- --- ------- --------- ----------------------------------------2s58n6d3mzkmn .07 0 Yes 100.00 select count(*) from kso.skew3 wherecol3 = '20-OCT-2005'fuhmg9hqdbd84 14.00 0 Yes 99.99 select count(*) from kso.skew3 wherecol3 = '20-OCT-05'2 rows selected.SYS@EXDB1> select * from table(dbms_xplan.display_cursor('&sql_id','&child_no','typical'));Enter value for sql_id: fuhmg9hqdbd84Enter value for child_no:PLAN_TABLE_OUTPUT--------------------------------------------------------------------------------------------SQL_ID fuhmg9hqdbd84, child number 0-------------------------------------select count(*) from kso.skew3 where col3 = '20-OCT-05'Plan hash value: 2684249835120

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

Saved successfully!

Ooh no, something went wrong!