



Introduction:
Exadata Storage Server includes Exadata Hybrid Columnar Compression feature. This option provides very high levels of data compression implemented inside the Exadata Storage Server.
This feature allows the database to reduce the number of physical I/Os required to scan a table.
You can specify Exadata Hybrid Columnar Compression (EHCC) at various levels
- Table Level
- Partition Level
- Tablespace Level
You can also choose two types of Exadata Hybrid Columnar Compression (EHCC)
-
Warehouse Compression
- This option is for optimizing Query performance.
- Suitable for data warehouse applications.
- Two options : Query High and Query Low
-
Online Archival Compression
- This option is for optimized for maximum compression ratios.
- Suitable for data changes very rarely.
- Two options: Archive High and Archive Low
Table Compression Syntax:
-
Query Compression Syntax:
- CREATE TABLE emp (…) COMPRESS FOR QUERY [LOW | HIGH];
-
Archive Compression Syntax:
- CREATE TABLE emp (…) COMPRESS FOR ARCHIVE [LOW | HIGH];
Data Organization: Exadata Hybrid Columnar Compression (EHCC)
- Tables are organized into Compression Units (CU).
- Size typically 32k (4 blocks * 8k block size)
- Compression Units are larger than database blocks.
- With Compression Units (CU), Data is organized by column not on row.
- Logical Structure spanning multiple database blocks in the Database.
- Each column is compressed separately.
Comparison Study of Compression: Query High Vs Archive High:
Compression Method |
Object Name |
Object Size (MB) |
Object Creation Time (HH:MM:SI) |
No Compression |
ehcc_TEST |
25487.0625 |
|
Query High |
ehcc_Qehcc |
1280 |
00:10:45.01 |
Archive High |
ehcc_Aehcc |
848 |
00:40:32.26 |
Converting Compression to Non-Compression:
Object Name |
Object Size (MB) |
Object Conversion Time (HH:MM:SI) |
ehcc_Qehcc |
22942 |
00:03:08.42 |
ehcc_Aehcc |
22947 |
00:02:57.58 |
Scenario Example:
/*== Checking ehcc_TEST object size ==*/ SQL> set pagesize 2000 SQL> set long 10000 SQL> set linesize 200 SQL> set feedback on SQL> set echo on SQL> col segment_name format a18 SQL> SELECT segment_name,sum(bytes)/1024/1024 Size_MB FROM user_segments WHERE segment_name in ('ehcc_TEST') GROUP BY segment_name; SEGMENT_NAME Size_MB ———————————————————— ehcc_TEST 25487.0625 Elapsed: 00:00:00.59
/*== Creating Object with Query High Option ==*/ SQL> CREATE TABLE ehcc_Qehcc COMPRESS FOR QUERY HIGH AS SELECT * FROM ehcc_TEST; Table created. Elapsed: 00:10:45.01
/*== Creating Object with Archive Option ==*/ SQL> CREATE TABLE ehcc_Aehcc COMPRESS FOR ARCHIVE HIGH AS SELECT * FROM ehcc_TEST; Table created. Elapsed: 00:40:32.26
/*== Check the amount of space saving achieved, by viewing the segments ==*/ SQL> SELECT segment_name,sum(bytes)/1024/1024 Size_MB FROM user_segments WHERE segment_name in ('ehcc_Qehcc','ehcc_Aehcc') GROUP BY segment_name; SEGMENT_NAME Size_MB ———————————————————— ehcc_Aehcc 848 ehcc_Qehcc 1280 Elapsed: 00:00:00.48
/*== View the COMPRESSION and COMPRESS_FOR columns in the USER_TABLES view ==*/ SQL> set timing off SQL> set echo on SQL>select table_name,compression,compress_for from user_tables where table_name in ('ehcc_Aehcc', 'ehcc_Qehcc', 'ehcc_TEST'); TABLE_NAME COMPRESS COMPRESS_FOR —————————— —————— ————————- ehcc_Aehcc ENABLED ARCHIVE HIGH ehcc_Qehcc ENABLED QUERY HIGH ehcc_TEST DISABLED 3 rows selected.
/*== Converting from Compression to Non-Compression ==*/ SQL> ALTER TABLE ehcc_Qehcc MOVE NOCOMPRESS PARALLEL; Table altered. Elapsed: 00:03:08.42 SQL> ALTER TABLE ehcc_Aehcc MOVE NOCOMPRESS PARALLEL; Table altered. Elapsed: 00:02:57.58
/*== Checking size of the Objects after conversion ==*/ SQL> SELECT segment_name,sum(bytes)/1024/1024 Size_MB FROM user_segments WHERE segment_name in ('ehcc_Qehcc','ehcc_Aehcc') GROUP BY segment_name; SEGMENT_NAME Size_MB ———————————————————— ehcc_Aehcc 22947 ehcc_Qehcc 22942 Elapsed: 00:00:00.53
/*== Checking Object count ==*/ SQL>SELECT COUNT(*) FROM ehcc_TEST; COUNT(*) —————- 102938023 Elapsed: 00:00:07.11 SQL> SELECT COUNT(*) FROM ehcc_Qehcc; COUNT(*) —————- 102938023 Elapsed: 00:00:06.75 SQL> SELECT COUNT(*) FROM ehcc_Aehcc; COUNT(*) —————- 102938023 Elapsed: 00:00:06.72
Note: Applied Environment a. Oracle Enterprise Edition 11gR2 (11.2.0.3.0) b. Oracle Exadata Quarter Rack c. Oracle Linux 5.5 x86-64 |
Exadata Hybrid Columnar Compression (EHCC) Fully Supports:
- B-Tree, Bitmap Indexes, Text indexes
- Materialized Views
- SmartScan Offload Operations
- Partitioning
- Parallel Query, PDML, PDDL
- Schema Evolution Support, Online, Metadata-Only Add/Drop Columns
- Data Guard Physical Standby Support
Exadata Hybrid Columnar Compression (EHCC) Fully Supports Storage Solutions:
- Oracle Exadata
- Oracle Exadata Expansion Rack
- Pillar Axiom
- ZFS Storage Appliance
- SuperCluster
Exadata Hybrid Columnar Compression (EHCC) Benefit Across Stack:
- Storage
- Disk Bandwidth
- Flash Cache
- DRAM Cache
- Test Environment, Development Environment & DR Environment
- Database Backups
Exadata Hybrid Columnar Compression (EHCC) Estimation:
New Advisor in Oracle Database 11g Release 2
- DBMS_COMPRESSION PL/SQL Package
Note: Before executing compression advisor create separate tablespace in database as it creates temporary tables and will do significant amount of I/O. Recommended time for compression advisor during less busy periods for the database.
Exadata Hybrid Columnar Compression (EHCC) Guidelines:
- Exadata Hybrid Columnar Compression (EHCC) achieves its highest levels of data compression with data that is direct-path inserted.
- Exadata Hybrid Columnar Compression (EHCC) is not recommended for tables that are modified most often in the database.
- Exadata Hybrid Columnar Compression (EHCC) is not allowed on Index Organized Tables (IOT).
Yenugula Venkata RaviKumar is a DBA with over 15 years of experience specialized in high availability database environments (RAC, Data Guard, among others), tuning and performance, migrations, backup and recovery, Oracle Exadata v1/v2/v3, expert in operating systems such as AIX, HP-UX y Linux . He has participated as lecturer in several Oracle events in India where he currently resides. He obtained an Oracle Certified Master (OCM) from Oracle Corporation in 2009.
Deiby Gómez is an Expert DBA, with experience in Oracle Exadata Database Machine and High Availability Solutions . He gives conferences frequently on distinct Oracle events in Guatemala, among them OTN LAD Tour, Java Day, First Symposium of Oracle and many Universities. Oracle ACE since 2013. Deiby is the first Guatemalan to publish articles in Oracle LAD and constantly publishes articles on his blog www.oraclefromguatemala.com.gt.



