Question:
I hear that 11g data compression stores related columns together on the disk data blocks, very different from a regular Oracle table where related rows are stored together on the data blocks? How does column-oriented data storage work in Oracle? When is it useful for performance to group-together columns?
Answer: Oracle is the world's most flexible database, and Oracle can provide column-oriented storage.
- In a regular database, related rows are stored together on the data block.
- With 11g data compression, related columns are stored together on the data blocks.
In 11g data compression, all like-minded columns are stored contiguously, so that changes to column values are
high compressed:
This article describes Oracle column data storage options with data encryption.
It's clear that 11g data compression offers these huge benefits, but the exact overhead costs remain unknown. Oracle explains that there new 11g data compression algorithm:
"The algorithm works by eliminating duplicate values within a database block, even across multiple columns. Compressed blocks contain a structure called a symbol table that maintains compression metadata.
When a block is compressed, duplicate values are eliminated by first adding a single copy of the duplicate value to the symbol table. Each duplicate value is then replaced by a short reference to the appropriate entry in the symbol table."
Oracle shows the internals of Oracle data compression data storage on the blocks here:
Oracle block compression alters rows storage for column-oriented data. Source: Oracle Corporation
Jeremiah Wilton has a blockdump of TDE, showing the column-oriented data storage.:
Also see my related
notes on TDE: