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 SCANmeans that Predicate Filtering and Storage Indexes cannot be used to cut down the volume of data thatmust be transferred from the storage tier, because those two optimizations can only be done when thereis a WHERE clause (we’ll discuss those optimizations shortly). That leaves Column Projection as the onlyoptimization in play. Are you surprised that Column Projection alone could cut a query’s response timein half? We were, the first time we saw it, but it makes sense if you think about it. You should be awarethat columns in the select list are not the only columns that must be returned to the database server.This is a very common misconception. Join columns in the WHERE clause must also be returned. As amatter of fact, in early versions of <strong>Exadata</strong>, the Column Projection feature was not as effective as it couldhave been and actually returned all the columns included in the WHERE clause, which in many casesincluded some unnecessary columns.The DBMS_XPLAN package can display information about column projection, although by default itdoes not. The projection data is stored in the PROJECTION column in the V$SQL_PLAN view as well. Here isan example:SYS@SANDBOX> select count(s.col1),avg(length(s.col4))2 from kso.skew s, kso.skew2 s23 where s.pk_col = s2.pk_col4 and s.col1 > 05 and s.col2='asddsadasd';COUNT(S.COL1) AVG(LENGTH(S.COL4))------------- -------------------127999992 11 row selected.SYS@SANDBOX> select sql_id, child_number, sql_text2 from v$sql where sql_text like '%skew%';SQL_ID CHILD SQL_TEXT------------- ------ --------------------------------------------------------------8xa3wjh48b9ar 0 select count(s.col1),avg(length(s.col4)) from kso.skew s, kso.1 row selected.SYS@SANDBOX> select * from2 table(dbms_xplan.display_cursor('&sql_id','&child_no','+projection'));Enter value for sql_id: 8xa3wjh48b9arEnter value for child_no:PLAN_TABLE_OUTPUT------------------------------------------------------------------------------SQL_ID 8xa3wjh48b9ar, child number 0-------------------------------------select count(s.col1),avg(length(s.col4)) from kso.skew s, kso.skew2 s2where s.pk_col = s2.pk_col and s.col1 > 0 and s.col2='asddsadasd'Plan hash value: 336115206629

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

Saved successfully!

Ooh no, something went wrong!