10.07.2015 Views

Expert Oracle Exadata - Parent Directory

Expert Oracle Exadata - Parent Directory

Expert Oracle Exadata - Parent Directory

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 2 OFFLOADING / SMART SCANSystem altered.Elapsed: 00:00:00.17SYS@SANDBOX> select count(pk_col) from kso.skew3 where col1 < 0;COUNT(PK_COL)-------------2Elapsed: 00:00:08.53First we completely disabled Offloading using the CELL_OFFLOAD_PROCESSING parameter and ran aquery without a WHERE clause. Without the benefit of Offloading this query took about 48 seconds. Wethen enabled Offloading and re-ran the query. This time the query took only about 27 seconds. Thesavings of approximately 21 seconds was due strictly to Column Projection (because without a WHEREclause for filtering, there were no other optimizations that could come into play). We then used a trick todisable storage indexes by setting the hidden parameter, _KCFIS_STORAGEIDX_DISABLED, to TRUE (we’lldiscuss that more in the next section) and added a WHERE clause, which reduced the execution time toabout 9 seconds. This reduction of an additional 18 seconds or so was thanks to Predicate Filtering. Notethat we had to disable storage indexes to be sure that we weren’t getting any benefit from thatoptimization and that all the improvement was due to Predicate Filtering, which brings us to the nexttopic.Storage IndexesStorage Indexes provide the third level of optimization for Smart Scans. Storage Indexes are in-memorystructures on the storage cells that maintain a maximum and minimum value for each 1MB disk storageunit, for up to eight columns of a table. Storage Indexes are a little different than most Smart Scanoptimizations. The goal of Storage Indexes is not to reduce the amount of data being transferred back tothe database tier. In fact, whether they are used on a given query or not, the amount of data returned tothe database tier remains constant. On the contrary, Storage Indexes are designed to eliminate timespent reading data from disk on the storage servers themselves. Think of this feature as a pre-filter. SinceSmart Scans pass the query predicates to the storage servers, and Storage Indexes contain a map ofvalues in each 1MB storage region, any region that can’t possibly contain a matching row can beeliminated without ever being read. You can also think of Storage Indexes as an alternate partitioningmechanism. Disk I/O is eliminated in analogous fashion to partition elimination. If a partition can’tcontain any records of interest, the partition’s blocks will not be read. Similarly, if a storage regioncannot contain any records of interest, that storage region need not be read.Storage Indexes cannot be used in all cases, and there is little that can be done to affect when or howthey are used. But in the right situations, the results from this optimization technique can beastounding.Here is an example:SYS@SANDBOX> -- disable storage indexesSYS@SANDBOX> alter system set "_kcfis_storageidx_disabled"=true;System altered.Elapsed: 00:00:00.22SYS@SANDBOX> select count(pk_col) from kso.skew3 where col1 < 0;33

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

Saved successfully!

Ooh no, something went wrong!