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 INDEXESreturned entire blocks to the database grid, just as it would on non-<strong>Exadata</strong> storage environments.Offloading was then re-enabled and the query was repeated. This time it completed in about 24 seconds.The improvement in elapsed time was primarily due to column projection since the storage layer onlyhad to return a counter of rows, instead of returning any of the column values.A very selective WHERE clause was then added to the query; it reduced the time to about 14 seconds.This improvement was thanks to predicate filtering. Remember that Storage Indexes were still turnedoff. A counter for only 12 rows had to be returned to the database machine, but the storage cells still hadto read all the data to determine which rows to return. Finally the Storage Indexes were re-enabled, bysetting _KCFIS_STORAGEIDX_DISABLED to FALSE, and the query with the WHERE clause was executed again.This time the elapsed time was only about 1 second. While this performance improvement seemsextreme, it is relatively common when Storage Indexes are used.Special Optimization for NullsNulls are a special case for Storage Indexes. There is a separate flag in the Storage Index structure that isused to indicate whether a storage region contains nulls or not. This separate flag makes queries lookingfor nulls (or the absence of nulls) even more efficient than the normal minimum and maximumcomparisons that are typically done. Here’s an example comparing typical performance with andwithout the special null optimization.SYS@EXDB1> set timing onSYS@EXDB1> select count(*) from kso.skew3 where col1 =10000;COUNT(*)----------0Elapsed: 00:00:14.47SYS@EXDB1> @siNAMEVALUE--------------------------------------------- ---------------cell physical IO bytes saved by storage index 3915776Elapsed: 00:00:00.00SYS@EXDB1> select count(*) from kso.skew3 where col1 is null;COUNT(*)----------4Elapsed: 00:00:00.12SYS@EXDB1> @siNAMEVALUE--------------------------------------------- ---------------cell physical IO bytes saved by storage index 15954714624Elapsed: 00:00:00.00In this example you can see that retrieval of a few nulls was extremely fast. This is because there isno possibility that any storage region that doesn’t contain a null will have to be read , so no false116

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

Saved successfully!

Ooh no, something went wrong!