Demystifying Oracle HCC
What is Hybrid Columnar Compression (HCC)?
No extra licensing is needed if you’re on Exadata—it’s baked right in.
How Does HCC Work Under the Hood?
To grasp HCC, picture loading data in bulk (via direct-path inserts, like those using the APPEND hint or SQL*Loader). Oracle doesn’t just slap rows into blocks; it:
A CU is a self-contained unit spanning multiple blocks (up to 8MB in Exadata). It stores entire rows but reorganizes column data for compression—similar values (e.g., repeated warehouse codes) are dictionary-encoded, storing the value once with references to rows.
Unlike pure columnar stores that require fetching one I/O per column, HCC keeps rows intact within the CU. Compression algorithms (like run-length encoding for low-cardinality columns) squeeze the data without reordering rows, preserving relational integrity.
- Handles Queries Efficiently: During a full table scan, Exadata’s Smart Scan offloads processing to storage cells. Only relevant compressed columns are decompressed and filtered on-the-fly, slashing I/O by the compression ratio. For example, a 10x compressed table means 10x less data read from disk.
Data stays compressed throughout its lifecycle—from disk to buffer cache, backups via RMAN, and even Data Guard replication. This “always-compressed” model is what sets HCC apart from basic compression methods.
HCC Compression Levels: Choosing the Right Fit
HCC offers four levels, balancing storage savings, load times, and query speed. They’re specified during table creation or alteration using clauses like COMPRESS FOR QUERY HIGH.
- Query High
- Up to 10x
- Balanced analytics workloads
- Optimal for Exadata scans; minor CPU hit
- Archive Low
- Up to 10x
- Infrequently accessed historical data
- Good for ILM (Information Lifecycle Management)
- Archive High
- Up to 15x
- Maximum storage savings for cold data
- Slower queries; high CPU for decompression
levels shine in active data warehouses, where scan performance is king. levels are ideal for archiving old partitions to cheaper storage, enabling queries against “tape-like” data at speeds orders of magnitude faster than traditional archives.Ratios vary by data—highly repetitive datasets (e.g., sales logs with common dates) compress best. Always test with your workload!
The Benefits: Why Bother with HCC?
Adopting HCC isn’t just about saving space; it’s a strategic win:
- Massive Storage Savings: Turn a 100TB database into 10TB or less, delaying hardware upgrades and cutting costs. On Exadata X9M, you can pack over 3.2PB per cell at 15:1 ratios.
- I/O and Performance Boost: Fewer blocks mean faster scans—up to 10x I/O reduction translates to blazing query times, especially for aggregations in BI tools like Oracle Analytics.
- Cost Efficiency: Reduces the need for extra disks in Exadata racks and supports ILM by tiering hot data to SSDs and cold to HDDs.
- Seamless Integration: No app changes required. It plays nice with partitioning, partitioning compression, and features like Real Application Clusters (RAC).
In real-world benchmarks, HCC has helped organizations like financial firms compress terabytes of transaction history without sacrificing accessibility.
Implementing HCC: An Example Step-by-Step Guide
Create a Compressed Table:
sql
CREATE TABLE sales_data (
id NUMBER,
date_col DATE,
amount NUMBER
) COLUMN STORE COMPRESS FOR QUERY HIGH;
- Load Data in Bulk: Use INSERT /*+ APPEND */ or parallel CTAS (CREATE TABLE AS SELECT) for max ratios. Conventional DML works but compresses less.
- Compress Existing Tables:
Offline: ALTER TABLE sales_data MOVE COMPRESS FOR ARCHIVE HIGH;
- Online (12c+): ALTER TABLE sales_data MOVE ONLINE COMPRESS FOR QUERY HIGH; (requires Advanced Compression option).
Or use DBMS_REDEFINITION for zero-downtime migrations.
- Monitor and Maintain: Query V$SEGMENT_STATISTICS for compression stats. For DML-heavy tables, consider Automatic Storage Compression—it loads uncompressed then compresses in the background via AutoTask.
Pro Tip: Disable foreign keys during APPEND loads, then re-enable.
Avoid HCC for tables with frequent updates, as DML can fragment CUs and degrade ratios.Limitations to note: No support for indexes (use Advanced Index Compression separately), LOBs, or object-relational features. Transportable tablespaces require decompressing first. Row locks apply to entire CUs during updates, potentially impacting concurrency.
When Should You Use HCC?
HCC is a no-brainer for read-heavy environments like data warehouses, reporting marts, or archival systems.If your workload involves 80%+ scans and minimal updates, you’ll reap the rewards. For OLTP? Stick to basic or Advanced Compression.As data grows—projected to hit 175 zettabytes by 2025—technologies like HCC will be essential for keeping Oracle databases lean and mean.
Wrapping Up: Compress Smarter, Not Harder
Useful links to HCC
- Oracle Hybrid Columnar Compression Overview (Oracle Whitepaper, PDF)
- Link: https://www.oracle.com/a/ocom/docs/database/hybrid-columnar-compression-brief.pdf
- Used for: Core explanation of HCC, compression ratios (up to 10x/15x), and integration with Exadata Smart Scans.
- Hybrid Columnar Compression (HCC) (Oracle Technical Brief, PDF)
- Link: https://www.oracle.com/ocom/groups/public/@otn/documents/webcontent/200703.pdf
- Used for: Benefits of hybrid row/columnar storage, performance advantages, and “always-compressed” lifecycle.
- Oracle Hybrid Columnar Compression (Oracle Exadata Technical Whitepaper, PDF)
- Link: https://www.oracle.com/technetwork/database/exadata/ehcc-twp-131254.pdf
- Used for: Detailed workings of Compression Units (CUs), query vs. archive levels, and Exadata-specific features.
- Exadata Database Machine – “Hybrid Columnar Compression (HCC)” (Medium Article by Cloudevolving Data)
- Link: https://medium.com/@cloudevolvingdata/exadata-database-machine-hybride-columnar-compression-hcc-57db2d9cb56b
- Used for: Real-world cost savings examples and grouping of column data for compression.
- Hybrid Columnar Compression (AWS Prescriptive Guidance)
- Link: https://docs.aws.amazon.com/prescriptive-guidance/latest/oracle-exadata-blueprint/hcc.html
- Used for: Comparison of compression ratios across Oracle options and cloud deployment notes.
- Oracle Hybrid Columnar Compression (Oracle A/OCOM Docs, PDF)
- Link: https://www.oracle.com/a/ocom/docs/ehcc-twp-131254.pdf
- Used for: Enterprise cost-savings, performance boosts, and I/O reduction metrics.
- Exadata Hybrid Columnar Compression (HCC) for (Storage) Dummies (Dirty Cache Blog)
- Link: https://dirty-cache.com/2012/08/03/exadata-columnar-for-dummies/
- Used for: Simplified analogy of row vs. columnar storage and disk block organization.
- Hybrid Columnar Compression in Autonomous Transaction Processing (LinkedIn Article by Cristiano Ghirardi)
- Link: https://www.linkedin.com/pulse/hybrid-columnar-compression-autonomous-transaction-cristiano-ghirardi-poecf
- Used for: Modern use cases in ATP and historical data archiving.
- Exadata Hybrid Columnar Compression (EHCC) FAQ (Oracle DBA Blog)
- Link: https://odba.in/exadata-hybrid-columnar-compression-ehcc-faq/
- Used for: Implementation steps (e.g., CREATE TABLE syntax, ALTER MOVE), limitations (e.g., indexes, LOBs), and monitoring queries.


Leave a Comment