Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright 2013, Zero Defect Computing, Inc. When Smart Scan Plays Dumb, Teach Exadata Some New Tricks Jim Czuprynski Zero Defect Computing, Inc. April.

Similar presentations


Presentation on theme: "Copyright 2013, Zero Defect Computing, Inc. When Smart Scan Plays Dumb, Teach Exadata Some New Tricks Jim Czuprynski Zero Defect Computing, Inc. April."— Presentation transcript:

1 Copyright 2013, Zero Defect Computing, Inc. When Smart Scan Plays Dumb, Teach Exadata Some New Tricks Jim Czuprynski Zero Defect Computing, Inc. April 17, 2013

2 - 2 - Copyright 2013, Zero Defect Computing, Inc. My Credentials 30+ years of database-centric IT experience Oracle DBA since 2001 Oracle 9i, 10g, 11g OCP 95+ articles on databasejournal.com and ioug.org Teach core Oracle DBA courses (G/I+RAC, Exadata, Performance Tuning, Data Guard) 2009: Oracle Education Partner Trainer of the Year Speaker at Oracle OpenWorld, IOUG COLLABORATE11, and IOUG COLLABORATE13 Oracle-centric blog (Generally, It Depends)

3 - 3 - Copyright 2013, Zero Defect Computing, Inc. Our Agenda Smart Scan is part of the Exadata Database Machines secret sauce... but its not perfect. This presentation therefore aims to: Demonstrate how Smart Scan typically reduces query execution time Identify why Smart Scan sometimes plays dumb and chooses sub-optimal retrieval methods Reveal when Smart Scan isnt the cheapest method to answer a query Explore how to resolve these issues by helping Smart Scan to raise its query IQ whenever possible

4 Copyright 2013, Zero Defect Computing, Inc Exadata Database I/O User issues query: SELECT key_id, key_desc FROM ap.ehcc_parted WHERE key_sts <> Y; SmartScan-enabled execution plan: TABLE ACCESS STORAGE FULL (AP.EHCC_PARTED) AUs 3 6 iDB command generated and issued to Exadata storage cells Storage cells determine which ASM AUs answer the query Result set built from just rows and columns needed to satisfy query Result set containing just data elements needed is FETCHed 4 rows X 2 cols 80 bytes 4 30M rows (4 GB)

5 - 5 - Copyright 2013, Zero Defect Computing, Inc. Smart Scan and Smart Storage Complex DSS and OLAP queries may need huge numbers of database blocks to be retrieved, usually via full scans of extremely large row sources (tables as well as indexes) Smart Scan retrieves only the necessary data as efficiently as possible Smart Storage determines if corresponding blocks are already in Exadata servers buffer caches Exadata knows not only which database blocks are already available in memory, but how applications are using each block

6 - 6 - Copyright 2013, Zero Defect Computing, Inc. Smart Flash Features Leverages Exadata storage cells write-through- cache flash memory Overcomes intrinsic limitations of HDDs Smart Flash Cache extends databases buffer cache size dramatically Smart Flash Logging can accelerate online redo log writes (and thus speed COMMITs) Flash-based Grid Disks can be deployed for intense random access requirements Top rated speed per storage cell: 10K IOPS Total I/O response time per X2-2 full rack: 1.5M IOPS

7 - 7 - Copyright 2013, Zero Defect Computing, Inc. Column and Predicate Filtering Exadata also dramatically limits the amount of data retrieved when selection criteria and specific columns are mentioned in a SQL statement: Predicate filtering captures only those rows necessary to answer query Column filtering (aka column projection) captures only those columns necessary to answer query Only the data elements (columns X rows) needed for the statement are returned Think: SQL Results Query Cache

8 - 8 - Copyright 2013, Zero Defect Computing, Inc. Storage Indexes Automatically built in Exadata storage cells memory Region indexes map which AUs contain ranges of column data values Storage indexes are built upon region indexes Storage cells thus know exactly which AUs can be used to answer a predicate Only way to see them: Positive impact on query performance Cell-specific instance statistics Sensitive to sort order during initial data load

9 - 9 - Copyright 2013, Zero Defect Computing, Inc. Hybrid Columnar Compression Hybrid Columnar Compression (HCC) provides two extra data compression methods: Warehouse Compression (10X – 15X): Data thats accessed relatively infrequently Archival Compression (15X – 50X): Data thats only retained for long-term periods or just for regulatory requirements Compute nodes perform compression Storage cells perform decompression Compression units store compressed data

10 Copyright 2013, Zero Defect Computing, Inc HCC: Compression Units Compression Unit Block Header CU Header C1 C2 Block Header C2 C3 C4 C5 Block Header C5 C6 Block Header C8C7 A compression unit (CU) is a new logical structure that spans multiple database blocks Row and column data is completely reorganized based on individual column values Every column is separately compressed Rows do not span multiple CUs Smart Scan benefits dramatically from CUs

11 Why Didnt Smart Scan Happen?

12 Copyright 2013, Zero Defect Computing, Inc. Доверяй, но проверяй Did Smart Scan Really Happen? So trust the expected EXPLAIN PLAN … … but then verify: The actual post-execution plan Instance statistics specific to Smart Scan Wait events related to Smart Scan (Doveryai, no proveryai)Trust, but verify As Reagan once said to Gorbachev:

13 Copyright 2013, Zero Defect Computing, Inc. Conditions Preventing Smart Scan For DSS or Data Warehousing application workloads, Smart Scan may not occur because: Dynamic Sampling is invoked A Flashback Versions Query is requested Predicates specified for a virtual column Query against a LONG or LOB datatype Row-level dependency is enabled Over 255 columns in a query* * Unless HCC is used on all tables in query!

14 Copyright 2013, Zero Defect Computing, Inc. Conditions Preventing Smart Scan For OLTP or hybrid OLTP / DSS application workloads, other factors may come into play: Fast Full Index Scans are prohibited for: Reverse key indexes (common for RAC) Compressed indexes (common for parent-child tables) Full scans on index-organized tables (IOTs) Full scans on clustered tables ORA_ROWSCN virtual column requested Optimizer decides to return rows in ROWID order Tables are just too small!

15 Copyright 2013, Zero Defect Computing, Inc A successful Smart Scan of the PK index is shown in both the EXPLAIN PLAN and statistics | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | | 0 | SELECT STATEMENT | | 1 | 6 | 1804 (2)| 00:00:22 | | 1 | SORT AGGREGATE | | 1 | 6 | | | | 2 | PX COORDINATOR | | | | | | | 3 | PX SEND QC (RANDOM) | :TQ10000 | 1 | 6 | | | | 4 | SORT AGGREGATE | | 1 | 6 | | | | 5 | PX BLOCK ITERATOR | | 1500K| 8789K| 1804 (2)| 00:00:22 | |* 6 | INDEX STORAGE FAST FULL SCAN| RANDOMIZED_SORTED_PK | 1500K| 8789K| 1804 (2)| 00:00:22 | Statistic Name Bytes (MB) physical read total bytes cell physical IO interconnect bytes cell physical IO bytes eligible for predicate offload cell physical IO bytes saved by storage index.00 cell physical IO interconnect bytes returned by smart scan cell IO uncompressed bytes.00 SELECT MIN(key_id), AVG(key_id), MAX(key_id) FROM ap.randomized_sorted WHERE key_id BETWEEN AND ; Smart Scan can use the primary key index for table AP.RANDOMIZED_SORTED: A Successful Smart Scan

16 Copyright 2013, Zero Defect Computing, Inc Even though Fast Full Scan of PK index is indicated, statistics and waits show it didnt happen at all! | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | | 0 | SELECT STATEMENT | | 1 | 4 | 5 (0)| 00:00:01 | | 1 | SORT AGGREGATE | | 1 | 4 | | | | 2 | INDEX STORAGE FAST FULL SCAN| INVOICES_PK_IDX | 4500 | | 5 (0)| 00:00:01 | Statistic Name Bytes (MB) physical read total bytes.22 physical write total bytes.00 cell physical IO interconnect bytes.22 cell physical IO bytes eligible for predicate offload.00 cell physical IO bytes saved by storage index.00 cell physical IO interconnect bytes returned by smart scan.00 cell IO uncompressed bytes.00 Total Total Wait Avg Wait Wait Event Waits Time (s) Time (s) cell single block physical read cell multiblock physical read SELECT MIN(invoice_id), MAX(invoice_id) FROM ap.invoices; In this example, the primary key index for table AP.INVOICES cannot be used for Smart Scan: Impact: REVERSE KEY Index

17 Copyright 2013, Zero Defect Computing, Inc. Conditions Preventing Smart Scan Some factors may be incidental, difficult to isolate, and perhaps non-negotiable: Indexed retrieval may still be faster than table scans Initialization parameters may affect optimizer decisions (e.g. OPTIMIZER_INDEX_COST_ADJUST ) Parallel processing may not have been chosen Hidden initialization parameters actually govern whether Smart Scan can be utilized

18 Copyright 2013, Zero Defect Computing, Inc. Secret Initialization Parameters Three hidden parameters impact Smart Scan: _small_table_threshold Determines if a table is small Specified in number of blocks (e.g. 512 x 8KB = 4MB) _serial_direct_read Will force Smart Scan when theres no parallelism Default: FALSE _direct_read_decision_statistics_driven New in Oracle Database Set to TRUE by default

19 Copyright 2013, Zero Defect Computing, Inc Fast Full Scan of PK index fails because the total number of blocks scanned is well below the size of _smart_table_threshold | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | | 0 | SELECT STATEMENT | | 1 | 6 | 441 (1)| 00:00:06 | | 1 | SORT AGGREGATE | | 1 | 6 | | | |* 2 | INDEX RANGE SCAN| RANDOMIZED_SORTED_PK | 200K| 1171K| 441 (1)| 00:00:06 | Statistic Name Bytes (MB) physical read total bytes 3.55 cell physical IO interconnect bytes 3.55 cell physical IO bytes eligible for predicate offload.00 cell physical IO bytes saved by storage index.00 cell physical IO interconnect bytes returned by smart scan.00 cell IO uncompressed bytes.00 Total Total Wait Avg Wait Wait Event Waits Time (s) Time (s) cell single block physical read SELECT MIN(key_id), AVG(key_id), MAX(key_id) FROM ap.randomized_sorted WHERE key_id BETWEEN AND ; If a table or index is < 2% of current buffer cache size, then its excluded from Smart Scan: Impact: _small_table_threshold

20 Smart Scan: The Good, The Bad, and The Ugly (With apologies to Sergio Leone)

21 Copyright 2013, Zero Defect Computing, Inc SET SERVEROUTPUT ON DECLARE comp_blks NUMBER; unco_blks NUMBER; pcti_blks NUMBER; comp_rspb NUMBER; unco_rspb NUMBER; comp_ratio NUMBER; comp_type VARCHAR2(100); pcti_rspb NUMBER; BEGIN DBMS_COMPRESSION.GET_COMPRESSION_RATIO ( scratchtbsname => 'USERS',ownname => 'AP',tabname => 'RANDOMIZED_SORTED',partname => NULL,comptype => DBMS_COMPRESSION.COMP_FOR_QUERY_HIGH,blkcnt_cmp => comp_blks,blkcnt_uncmp => unco_blks,row_cmp => comp_rspb,row_uncmp => unco_rspb,cmp_ratio => comp_ratio,comptype_str => comp_type ); pcti_blks := ((comp_blks / unco_blks) * 100); pcti_rspb := ((comp_rspb / unco_rspb) * 100); DBMS_OUTPUT.PUT_LINE('Compression Type: ' || comp_type); DBMS_OUTPUT.PUT_LINE('Compression Ratio: ' || TO_CHAR(comp_ratio, ' ')); DBMS_OUTPUT.PUT_LINE('Uncompressed Blocks: ' || TO_CHAR(unco_blks, ' ')); DBMS_OUTPUT.PUT_LINE('Compressed Blocks: ' || TO_CHAR(comp_blks, ' ')); DBMS_OUTPUT.PUT_LINE('Block Compression %: ' || TO_CHAR(pcti_blks, ' ')); DBMS_OUTPUT.PUT_LINE('Uncompressed Rows Per Block: ' || TO_CHAR(unco_rspb, ' ')); DBMS_OUTPUT.PUT_LINE('Compressed Rows Per Block: ' || TO_CHAR(comp_rspb, ' ')); DBMS_OUTPUT.PUT_LINE('Rows Per Block Compression %: ' || TO_CHAR(pcti_rspb, ' ')); END; / Compression Advisor self-check validation successful. select count(*) on both Uncompressed and EHCC Compressed format = rows Compression Type: "Compress For Query Low" Compression Ratio: 2.90 Uncompressed Blocks: Compressed Blocks: 5305 Block Compression %: Uncompressed Rows Per Block: 191 Compressed Rows Per Block: 566 Rows Per Block Compression %: Using DBMS_COMPRESSION

22 Copyright 2013, Zero Defect Computing, Inc | Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time | | 0 | SELECT STATEMENT | | 3184K| 60M| | 3506 (4)| 00:00:43 | | 1 | PX COORDINATOR | | | | | | | | 2 | PX SEND QC (ORDER) | :TQ10006 | 3184K| 60M| | 3506 (4)| 00:00:43 | | 3 | SORT ORDER BY | | 3184K| 60M| | 3506 (4)| 00:00:43 | | 4 | PX RECEIVE | | 3184K| 60M| | 3506 (4)| 00:00:43 | | 5 | PX SEND RANGE | :TQ10005 | 3184K| 60M| | 3506 (4)| 00:00:43 | | 6 | SORT GROUP BY | | 3184K| 60M| | 3506 (4)| 00:00:43 | | 7 | PX RECEIVE | | 3184K| 60M| | 3506 (4)| 00:00:43 | | 8 | PX SEND HASH | :TQ10004 | 3184K| 60M| | 3506 (4)| 00:00:43 | | 9 | SORT GROUP BY ROLLUP | | 3184K| 60M| | 3506 (4)| 00:00:43 | | 10 | VIEW | | 3184K| 60M| | 3468 (3)| 00:00:42 | | 11 | SORT UNIQUE | | 3184K| 24M| 49M| 3468 (53)| 00:00:42 | … Statistic Name Bytes (MB) physical read total bytes cell physical IO interconnect bytes cell physical IO bytes eligible for predicate offload cell physical IO interconnect bytes returned by smart scan cell IO uncompressed bytes Total Total Wait Avg Wait Wait Event Waits Time (s) Time (s) cell list of blocks physical read cell single block physical read EHCC_PARTED: Partitioned on KEY_DATE, so parallelism can be used effectively | Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time | | 0 | SELECT STATEMENT | | 3184K| 60M| | (2)| 00:07:02 | | 1 | SORT GROUP BY ROLLUP | | 3184K| 60M| | (2)| 00:07:02 | | 2 | VIEW | | 3184K| 60M| | (2)| 00:07:00 | | 3 | SORT UNIQUE | | 3184K| 24M| 49M| (56)| 00:07:00 | | 4 | UNION-ALL | | | | | | | | 5 | HASH GROUP BY | | 1629K| 12M| 25M| (2)| 00:03:10 | |* 6 | TABLE ACCESS STORAGE FULL| RANDOMIZED_UNSORTED | 1652K| 12M| | 3899 (2)| 00:00:47 | | 7 | HASH GROUP BY | | 1184K| 9256K| 18M| (2)| 00:02:31 | Statistic Name Bytes (MB) physical read total bytes cell physical IO interconnect bytes cell physical IO bytes eligible for predicate offload cell physical IO interconnect bytes returned by smart scan cell IO uncompressed bytes Total Total Wait Avg Wait Wait Event Waits Time (s) Time (s) cell smart table scan cell single block physical read RANDOMIZED_UNSORTED: Same 30M rows, sorted in KEY_DESC order, but no parallelism | Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time | | 0 | SELECT STATEMENT | | 3184K| 60M| | (2)| 00:07:21 | | 1 | SORT GROUP BY ROLLUP | | 3184K| 60M| | (2)| 00:07:21 | | 2 | VIEW | | 3184K| 60M| | (2)| 00:07:19 | | 3 | SORT UNIQUE | | 3184K| 24M| 49M| (56)| 00:07:19 | | 4 | UNION-ALL | | | | | | | | 5 | HASH GROUP BY | | 1629K| 12M| 25M| (2)| 00:03:17 | |* 6 | TABLE ACCESS STORAGE FULL| RANDOMIZED_SORTED | 1652K| 12M| | 4435 (1)| 00:00:54 | | 7 | HASH GROUP BY | | 1184K| 9256K| 18M| (2)| 00:02:38 | Statistic Name Bytes (MB) physical read total bytes cell physical IO interconnect bytes cell physical IO bytes eligible for predicate offload cell physical IO interconnect bytes returned by smart scan cell IO uncompressed bytes Total Total Wait Avg Wait Wait Event Waits Time (s) Time (s) cell smart table scan cell multiblock physical read cell single block physical read RANDOMIZED_SORTED: 30M rows, sorted in KEY_ID order, but no parallelism possible HCC can make incredible differences in performance! Hybrid Columnar Compression Impact SELECT yrnbr, wknbr, SUM(counted) FROM ( SELECT TO_CHAR(key_date, 'yyyy') yrnbr,TO_CHAR(key_date, 'ww') wknbr,COUNT(*) counted FROM ap.randomized_sorted WHERE key_date BETWEEN TO_DATE(' ', 'yyyy-mm-dd') AND TO_DATE(' ', 'yyyy-mm-dd') GROUP BY TO_CHAR(key_date, 'yyyy'),TO_CHAR(key_date, 'ww') UNION SELECT TO_CHAR(key_date, 'yyyy') yrnbr,TO_CHAR(key_date, 'ww') wknbr,COUNT(*) counted FROM ap.randomized_sorted WHERE key_date BETWEEN TO_DATE(' ', 'yyyy-mm-dd') AND TO_DATE(' ', 'yyyy-mm-dd') GROUP BY TO_CHAR(key_date, 'yyyy'),TO_CHAR(key_date, 'ww') UNION SELECT TO_CHAR(key_date, 'yyyy') yrnbr,TO_CHAR(key_date, 'ww') wknbr,COUNT(*) counted FROM ap.randomized_sorted WHERE key_date >= TO_DATE(' ', 'yyyy-mm-dd') GROUP BY TO_CHAR(key_date, 'yyyy'),TO_CHAR(key_date, 'ww') ) GROUP BY ROLLUP (yrnbr, wknbr) ORDER BY yrnbr, wknbr;;

23 Copyright 2013, Zero Defect Computing, Inc. Impact of Sorted Row Sources Columns typically used as predicate targets can benefit dramatically from sorting during initial load A simple query against data sorted on ascending KEY_ID order when loaded: SELECT * FROM ap.randomized_sorted WHERE key_id BETWEEN AND ; | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | | 0 | SELECT STATEMENT | | | 644K| 186 (0)| 00:00:03 | | 1 | TABLE ACCESS BY INDEX ROWID| RANDOMIZED_SORTED | | 644K| 186 (0)| 00:00:03 | |* 2 | INDEX RANGE SCAN | RANDOMIZED_SORTED_PK | | | 46 (0)| 00:00:01 | Statistic Name Bytes (MB) physical read total bytes 1.21 cell physical IO interconnect bytes 1.21 cell physical IO bytes eligible for predicate offload.00 cell physical IO bytes saved by storage index.00 cell physical IO interconnect bytes returned by smart scan.00 cell IO uncompressed bytes.00 Total Total Wait Avg Wait Wait Event Waits Time (s) Time (s) cell single block physical read SELECT * FROM ap.randomized_unsorted WHERE key_id BETWEEN AND ; | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | | 0 | SELECT STATEMENT | | | 644K| 3893 (1)| 00:00:47 | |* 1 | TABLE ACCESS STORAGE FULL| RANDOMIZED_UNSORTED | | 644K| 3893 (1)| 00:00:47 | Statistic Name Bytes (MB) physical read total bytes cell physical IO interconnect bytes.83 cell physical IO bytes eligible for predicate offload cell physical IO bytes saved by storage index.27 cell physical IO interconnect bytes returned by smart scan.76 cell IO uncompressed bytes Total Total Wait Avg Wait Wait Event Waits Time (s) Time (s) cell single block physical read cell smart table scan And now the same query, but columns not sorted in KEY_ID order, results in a full table scan!

24 Copyright 2013, Zero Defect Computing, Inc. Is Smart Scan Always Optimal? Smart Scan may actually be more expensive than expected when: Row source row migration is excessive Row sources are partially or completely modified and these changes havent been committed yet Storage cell CPUs are overloaded These cases may be unavoidable without changing application logic or execution patterns!

25 Copyright 2013, Zero Defect Computing, Inc. Excessive Row Migration Row migration requires additional mandatory single-block reads to retrieve the migrated rows: This query uses a scalar function to filter about 18% of all rows based on the contents of the KEY_DESC column. SELECT * FROM ap.randomized_unsorted WHERE UPPER(SUBSTR(key_desc,1,3)) IN ('AAA','BBB','CCC','XXX','YYY','ZZZ'); | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | | 0 | SELECT STATEMENT | | 175K| 5657K| 4514 (15)| 00:00:55 | |* 1 | TABLE ACCESS STORAGE FULL| RANDOMIZED_UNSORTED | 175K| 5657K| 4514 (15)| 00:00:55 | Statistic Name Bytes (MB) physical read total bytes cell physical IO interconnect bytes cell physical IO bytes eligible for predicate offload cell physical IO interconnect bytes returned by smart scan cell IO uncompressed bytes Total Total Wait Avg Wait Wait Event Waits Time (s) Time (s) cell single block physical read cell smart table scan Then, those same rows are updated and the changes committed. Since the row size grows, row migration occurs. Note the resulting increase in physical reads and cell physical I/O interconnect bytes! | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | | 0 | SELECT STATEMENT | | 175K| 12M| 9814 (7)| 00:01:58 | |* 1 | TABLE ACCESS STORAGE FULL| RANDOMIZED_UNSORTED | 175K| 12M| 9814 (7)| 00:01:58 | Statistic Name Bytes (MB) physical read total bytes cell physical IO interconnect bytes cell physical IO bytes eligible for predicate offload cell physical IO interconnect bytes returned by smart scan cell IO uncompressed bytes Total Total Wait Avg Wait Wait Event Waits Time (s) Time (s) cell single block physical read cell multiblock physical read cell smart table scan

26 Copyright 2013, Zero Defect Computing, Inc. Partially Updated Row Sources If a querys row sources have been partially modified, but those changes are as yet uncommitted, it will cost significantly more to retrieve the unmodified data: Well use the identical query, which filters an 18% sample of the entire table based on the KEY_DESC columns contents. SELECT * FROM ap.randomized_unsorted WHERE UPPER(SUBSTR(key_desc,1,3)) IN ('AAA','BBB','CCC','XXX','YYY','ZZZ'); | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | | 0 | SELECT STATEMENT | | 175K| 5657K| 4514 (15)| 00:00:55 | |* 1 | TABLE ACCESS STORAGE FULL| RANDOMIZED_UNSORTED | 175K| 5657K| 4514 (15)| 00:00:55 | Statistic Name Bytes (MB) physical read total bytes cell physical IO interconnect bytes cell physical IO bytes eligible for predicate offload cell physical IO interconnect bytes returned by smart scan cell IO uncompressed bytes Total Total Wait Avg Wait Wait Event Waits Time (s) Time (s) cell single block physical read cell smart table scan Then, about 30% of the tables rows are updated … but since the row size grows, it forces row migration: Note the significant increases in physical reads, cell physical I/O interconnect bytes, and waits | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | | 0 | SELECT STATEMENT | | 175K| 12M| 9814 (7)| 00:01:58 | |* 1 | TABLE ACCESS STORAGE FULL| RANDOMIZED_UNSORTED | 175K| 12M| 9814 (7)| 00:01:58 | Statistic Name Bytes (MB) physical read total bytes cell physical IO interconnect bytes cell physical IO bytes eligible for predicate offload cell physical IO interconnect bytes returned by smart scan cell IO uncompressed bytes Total Total Wait Avg Wait Wait Event Waits Time (s) Time (s) cell single block physical read cell list of blocks physical read cell smart table scan

27 Copyright 2013, Zero Defect Computing, Inc. This query will retrieve a significant number of rows (well over 99%) from the table. SELECT * FROM ap.randomized_unsorted WHERE key_sts = 'Y' | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | | 0 | SELECT STATEMENT | | 2999K| 94M| 3929 (2)| 00:00:48 | |* 1 | TABLE ACCESS STORAGE FULL| RANDOMIZED_UNSORTED | 2999K| 94M| 3929 (2)| 00:00:48 | Statistic Name Bytes (MB) physical read total bytes cell physical IO interconnect bytes cell physical IO bytes eligible for predicate offload cell physical IO interconnect bytes returned by smart scan cell IO uncompressed bytes Total Total Wait Avg Wait Wait Event Waits Time (s) Time (s) cell smart table scan cell single block physical read Then all of the tables rows are updated by changing KEY_STS to Z, but again, no changes are committed. Note the horrendous increase in physical reads, cell physical I/O interconnect bytes, and waits! | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | | 0 | SELECT STATEMENT | | 2999K| 94M| 3929 (2)| 00:00:48 | |* 1 | TABLE ACCESS STORAGE FULL| RANDOMIZED_UNSORTED | 2999K| 94M| 3929 (2)| 00:00:48 | Statistic Name Bytes (MB) physical read total bytes cell physical IO interconnect bytes cell physical IO bytes eligible for predicate offload cell physical IO interconnect bytes returned by smart scan cell IO uncompressed bytes Total Total Wait Avg Wait Wait Event Waits Time (s) Time (s) cell single block physical read cell smart table scan If a querys row sources have been completely changed but those changes are as yet committed, the additional retrieval costs could be enormous! Fully Updated Row Sources

28 Copyright 2013, Zero Defect Computing, Inc. Statistic Name Bytes (MB) physical read total bytes physical write total bytes.00 cell physical IO interconnect bytes cell physical IO bytes sent directly to DB node to balanceCPU u cell physical IO bytes saved during optimized file creation.00 cell physical IO bytes saved during optimized RMAN file restore.00 cell physical IO bytes eligible for predicate offload cell physical IO bytes saved by storage index.00 cell physical IO interconnect bytes returned by smart scan table fetch continued row.00 cell IO uncompressed bytes Total Total Wait Avg Event Waits Time (s) Time (s) cell smart table scan Exadata may simply relocate query operations back to the buffer cache of one or more compute nodes when it detects a storage cells CPUs are overloaded: Overloaded CPUs on Storage Cells

29 Copyright 2013, Zero Defect Computing, Inc. Other Resources Tanel Poders excellent recent blogs on Smart Scanexcellent recent blogs Fritz Hooglands recent blogging on Oracle Exadata Smart Scan internalsOracle Exadata Smart Scan internals IOUG 2012 Exadata SIG presentation on Smart Scan from UBS Bank If I have seen farther than others, it is because I was standing on the shoulders of giants. - Sir Isaac Newton

30 Copyright 2013, Zero Defect Computing, Inc Thank You For Your Kind Attention Please fill out a session evaluation form! Session P65 When Smart Scan Plays Dumb, Teach Exadata Some New Tricks I f you have any questions or comments, feel free to: me at Follow my blog (Generally, It Depends): Follow me on Twitter Connect with me on LinkedIn (Jim Czuprynski)


Download ppt "Copyright 2013, Zero Defect Computing, Inc. When Smart Scan Plays Dumb, Teach Exadata Some New Tricks Jim Czuprynski Zero Defect Computing, Inc. April."

Similar presentations


Ads by Google