Partitioning, More Cost Savings, Better Performance, Better Management in 11g

Michael R. Messina, Management Consultant Rolta-TUSC, Oracle Open World 2010 (60 min)
Copyright © 2009 Rolta International, Inc., All Rights Reserved

Introduction
‡ Michael Messina ‡ Management Consultant with Rolta-TUSC ‡ Background includes Performance Tuning, High Availability and Disaster Recovery ‡ Using Oracle for approximately 16 years ‡ messinam@tusc.com ‡ www.tusc.com

Audience Experience
‡ How many have utilized Partitioning and what have been some of your experiences? ‡ How many have utilized Table Compression and index compression (prior to 11g Advanced Compression) and what are your thoughts/experiences? ‡ How many are using Advanced Compression in Production? Thoughts?

Goals ‡ Touch on industry challenges ± Explosive Data Growth ± Performance ± Costs Look at 2 Partitioning Features Introduced with 11g Examine 11g Advanced Compression and impact using 11g partitioning features Show how Partitioning and Advanced Compression together help address some of the industry challenges .

Industry Challenges ‡ Exploding Data Growth ± Got to keep up ‡ Performance ± Query Performance Degradation as data volumes increase ± Backup time increases as data volumes increase ‡ Costs .What are the True Costs? ± Disk Space Purchase / Backup / Space Management / Power / Cooling ‡ What can we do?? .

it's nothing compared to what it could be in just a few years. Data Growth of 60% is common. Data Growth 700 Database in 600 500 400 300 200 100 0 1 2 3 Year 4 5 .Exploding Data Growth ‡ If you think storing data is a challenge now.

BNET . . This trend has existed for over 10 years and is expected to continue for the foreseeable future.Performance Storage capacity grows at over 60% per year while performance improves at less than 10% per year.

Releasing your Database Performance .

Performance Ref Partitioning what is advertised Introduced with Oracle 11g Improves performance for parent child relationships Partitions the child with the parent Interval Partitioning what is advertised Introduced with 11g Same performance Benefits as Range partitioning .

child partitions created automatically when parent partitions are created . ‡ Ref Partitioning ± Introduced with 11g ± Simpler partition management.Manageability ‡ Interval Partitioning ± Introduced with 11g ± Defined using an interval ± Works much like Range Partitioning ± Partitions are created as needed eliminates need to manually add partitions.

Cost of Storage ± Direct Attached vs.60 True Business Storage Cost $40.70 $44.True Disk Costs The cost of managing storage hardware ranges from two to ten times the acquisition cost of the storage hardware.51 $6. SAN .54 ± $202.21 $7. BNET Cost/GB GB Util Rate 45% 80% 80% Real Cost per GB $20. Monash University.27 $22.10 $15. .20 .65 $18.33 ** The above costs are based on 16TB configuration.42 ± $222.$76 DAS SAN FC SAN SATA $9.

‡ Advanced Compression 11g ± Additional License Requirement ± Compression Maintained with all DML activity ± No re-orgs required after initial compression .Compression ‡ Index Compression since 8i ‡ Table Compression since 9i ± No Additional License Requirement ± Only for direct inserts ± Compression Not Maintained with updates and normal inserts ± Had to re-org table to re-compress over time.

Compression ‡ What can compression accomplish? ± Shrink size of tables? ± Shrink Size of indexes? ± Improve buffer cache utilization? ± Improve I/O disk visits? ± Improve performance? .

30% ‡ Minimize performance impact of larger data volumes? ± Disk Space. 20%. Backup/Recovery. 30% reduction? ‡ Reduce Size of Future Data? ± Can we impact growth by 10%. Server Resources ‡ Can we do all this without adding significant management overhead to the DBA? .What can we do ‡ Reduce Size of Existing? ± Can we get a 10%. 20%.

‡ Examine the true performance gain from Ref Partitioning ± Demonstrate the partitioned and unpartitioned performance ± Demonstrate the partitioned and compressed performance .Ref Partitioning ‡ Examine Space Impact of Partitioning ± Show disk space impact partitioned and unpartitioned.

Ref Partitioning Un-Partitioned Table Size ‡ ORDERS (78880 rows) SUM(BYTES)/1024 --------------4096 ‡ ORDER_ITEMS (499792 rows) SUM(BYTES)/1024 --------------16384 .

Ref Partitioning Impact on Table Sizes ‡ ORDERS (78880 rows) SUM(BYTES)/1024 --------------4736 ‡ ORDER_ITEMS (499792 rows) SUM(BYTES)/1024 --------------13950 * Surprisingly we see the child table size reduced .

oe.order_id = oi.'DD-MON-YYYY') AND TO_DATE('30-JUN1999'.quantity) order_total FROM oe.order_date BETWEEN TO_DATE('01-APR1999'.'DD-MON-YYYY') AND o.order_items oi WHERE o. 16 rows selected.Non Partitioned Table Performance SELECT o. sum(oi. Elapsed: 00:00:00.unit_price*oi..order_date. .orders o.order_id GROUP BY order_date ORDER BY order_date .Ref .93 .

Non Partitioned Table Performance Statistics ----------------------------------------1 recursive calls 0 db block gets 1967 consistent gets 1964 physical reads 0 redo size 970 bytes sent via SQL*Net to client 427 bytes received via SQL*Net from client 3 SQL*Net roundtrips to/from client 1 sorts (memory) 0 sorts (disk) 16 rows processed .Ref .

Elapsed: 00:00:00.quantity) order_total FROM oe..order_id = oi. sum(oi.'DD-MON-YYYY') AND TO_DATE('30-JUN1999'. 16 rows selected.order_items oi WHERE o.orders o.'DD-MON-YYYY') AND o.57 / 38% Improvement .order_date.unit_price*oi.order_date BETWEEN TO_DATE('01APR-1999'. . oe.order_id GROUP BY order_date ORDER BY order_date .57 * .Ref Partitioning Impact SELECT o.93 to .

from 1967 to 1630 / 17% Improvement LIO from 1964 to 1621 / 17% Improvement .Ref Partitioning Impact Statistics ----------------------------------------44 recursive calls 0 db block gets 1630 1621 0 896 427 3 1 0 16 consistent gets physical reads redo size bytes sent via SQL*Net to client bytes received via SQL*Net from client SQL*Net roundtrips to/from client sorts (memory) sorts (disk) rows processed * PIO .

‡ Examine the true performance gain from Interval Partitioning ± Demonstrate the partitioned and unpartitioned performance ± Demonstrate the partitioned and compressed performance .Interval Partitioning ‡ Examine Space Impact of Partitioning ± Show disk space impact partitioned and unpartitioned.

Interval .Non-Partitioned Table Size ‡ Un-Partitioned Table 889.888 Rows SUM(BYTES)/1024 --------------45056 .

888 Rows SUM(BYTES)/1024 --------------58816 * 45M to 58M represents and increase in size when table is partitioned. .Interval Partitioning Impact on Table Size Partitioned Table 889.

Non Partitioned Table Performance ‡ Un-Partitioned Table 889.Interval . 'DDMON-YYYY') and to_date('01-JAN-1983'. . avg(sal) from emp where hiredate between to_date('01-JAN-1982'..888 Rows SQL> select deptno. Elapsed: 00:00:03.37 . 'DD-MON-YYYY') group by deptno .

Interval .Non Partitioned Table Statistics Statistics -------------------------------7 recursive calls 0 db block gets 5548 consistent gets 5674 physical reads 0 redo size 546 bytes sent via SQL*Net to client 416 bytes received via SQL*Net from client 2 SQL*Net roundtrips to/from client 0 sorts (memory) 0 sorts (disk) 3 rows processed .

. 'DD-MON-YYYY') group by deptno . 'DD-MON-YYYY') and to_date('01-JAN1983'.37 to 1. Elapsed: 00:00:01.57 * 3. avg(sal) from emp_part where hiredate between to_date('01-JAN-1982'.888 Rows SQL> select deptno.57 / 53% Improvement ..Interval Partitioning Impact ‡ Partitioned Table 889.

Interval Partitioning Impact Statistics ----------------------------------1 recursive calls 0 db block gets 658 consistent gets 652 physical reads 0 redo size 546 bytes sent via SQL*Net to client 416 bytes received via SQL*Net from client 2 SQL*Net roundtrips to/from client 0 sorts (memory) 0 sorts (disk) 3 rows processed * LIO ± 5548 to 658 / 88% Improvement PIO ± 5674 to 653 / 88% Improvement .

Accomplished With Partitioning ‡Positive ± Reduced logical I/O ± Reduced Physical I/O ± Improved elapse time ‡Negative ± Increased the size of the table .

‡ ORDER_ITEMS (499792 rows) SUM(BYTES)/1024 --------------11520 * 29% reduction over partitioned table 17% reduction over Original table .Impact of Compression on Size of Ref-Partitioned Tables ‡ ORDERS (78880 rows) SUM(BYTES)/1024 --------------4352 * 8% reduction over partitioned table 5% increase on Original table.

43 seconds .53% improvement to original / 24% improvement partitioned un-compressed .Impact of Ref Partitioning and Compression Together Elapsed: 00:00:00.43 Statistics ------------------------------------1 recursive calls 0 db block gets 413 consistent gets 407 physical reads 0 redo size 896 bytes sent via SQL*Net to client 427 bytes received via SQL*Net from client 3 SQL*Net roundtrips to/from client 1 sorts (memory) 0 sorts (disk) 16 rows processed * .

888 Rows SUM(BYTES)/1024 --------------39168 * 39% reduction on partition and uncompressed table 13% reduction from original table .Impact of Compression on Size of Interval Partitioned Table Partitioned Table 889.

Original 5548 to 373 a 93% Imprv.Original 5677 to 367 a 93% Imprv.59 Statistics --------------------------------1 recursive calls 0 db block gets 373 consistent gets 367 physical reads 0 redo size 546 bytes sent via SQL*Net to client 416 bytes received via SQL*Net from client 2 SQL*Net roundtrips to/from client 0 sorts (memory) 0 sorts (disk) 3 rows processed * PIO . LIO .Impact of Interval Partitioning and Compression Together Elapsed: 00:00:00. Partitioned 658 to 373 a 43% Imprv. Partitioned 653 to 367 a 43% Imprv. .

.Partitioning and Compression Summary ‡ What can partitioning accomplish ± Improve Performance ‡ Break large table into chunks reducing I/O ± Minimize Management Cost ‡ Utilize interval and Ref partitioning where new partitions are created automatically. ‡ Manage though individual Partitions adding flexibility for Table and index Management ± Improve Database backup Performance ‡ Mark tablespaces holding older Data partitions Read-Only as it eliminates the need to backup with each full backup of the database.

Partitioning and Compression Summary What Can Compression Accomplish? ± Reduce Disk Space Costs ‡ Compress partitioned tables reducing the size of tables ± Improve Performance ‡ Compress tables to reduce I/O read operations .

‡ Interval Partitioning and Ref Partitioning reduces maintenance impact for partitioning .Partitioning Conclusions ‡ Partitioning can improve I/O utilization ‡ Partitioning can improve performance ‡ Partitioning increases space utilization ‡ Compression reduces space utilization ‡ Compression can improve performance ‡ Compression with partitioning can improve performance more then either of them alone and can reduce space utilization.

Questions/Discussion THANK YOU .

Sign up to vote on this title
UsefulNot useful