查看: 3454|回复: 1

[转载] 关于11.2的列压缩 frombeta文档

[复制链接]
论坛徽章:
407
紫蛋头
日期:2012-05-21 10:19:41迷宫蛋
日期:2012-06-06 16:02:49奥运会纪念徽章:足球
日期:2012-06-29 15:30:06奥运会纪念徽章:排球
日期:2012-07-10 21:24:24鲜花蛋
日期:2012-07-16 15:24:59奥运会纪念徽章:拳击
日期:2012-08-07 10:54:50奥运会纪念徽章:羽毛球
日期:2012-08-21 15:55:33奥运会纪念徽章:蹦床
日期:2012-08-21 21:09:51奥运会纪念徽章:篮球
日期:2012-08-24 10:29:11奥运会纪念徽章:体操
日期:2012-09-07 16:40:00
跳转到指定楼层
1#
发表于 2009-8-31 20:28 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
网上的解释炒来炒去,都没有正式的,特地从beta文档萜一段
Table Compression
The database can use table compression to eliminate duplicate values in a data block. For tables with highly redundant data, compression saves disk space, reduces memory use in the database buffer cache, and in some cases speeds query execution. Table compression is transparent to database applications.

Basic and OLTP Table Compression
Oracle Database supports the following types of table compression:

•Basic table compression

This type of compression is intended for data warehouse applications and offers a high compression ratio and low CPU overhead.

•OLTP table compression

This type of compression is intended for OLTP applications and offers a high compression ratio and low CPU overhead.

The database stores compressed rows in row-major format. All columns of one row are stored together, followed by all columns of the next row, and so on (see Figure 12-6). Duplicate values are replaced with a short reference to a symbol table stored at the beginning of the block. Thus, information needed to re-create the uncompressed data is stored in the data block itself.

Compressed data blocks look much like normal data blocks. Most database features and functions that work on regular data blocks also work on compressed blocks.

Hybrid Columnar Compression
In hybrid columnar compression, the database stores the same column for a group of rows together. This type of compression can provide a very high degree of size reduction. Database operations work transparently against these compressed objects so no application changes are required.

You can specify the following types of hybrid columnar compression depending on your requirements:

•Warehouse compression

This type of compression is intended for data warehouses. You can specify COMPRESS FOR QUERY at a low or high (default) level. Typically, a higher level has a higher compression ratio and cost during load and access time.

•Online archival compression

This type of compression is suitable for long-term archived data or OLTP partitions that rarely or never change. You can specify COMPRESS FOR ARCHIVE at a low (default) or high level.

Hybrid column compression does not store data in the row-major format used by basic and OLTP table compression. The database stores a row set in a compression unit, which is an internal storage format, and manages the compressed data transparently. For example, the database could divide a million-row sales table into row subsets and within each subset store product IDs together, customer IDs together, and so on.

Compression Declaration
You can declare compression at the tablespace, table, partition, or subpartition level. If specified at the tablespace level, then all tables created in that tablespace are compressed by default.

The following applies online archival compression to the sales table:

ALTER TABLE sales
ORGANIZATION HEAP
COMPRESS FOR ARCHIVE;
The following example of a CREATE TABLE statement specifies warehouse compression for one partition and online archival compression for the other partition:

CREATE TABLE sales (
    prod_id     NUMBER     NOT NULL,
    cust_id     NUMBER     NOT NULL, ... )
PCTFREE 5 NOLOGGING NOCOMPRESS
PARTITION BY RANGE (time_id)
( partition sales_1995 VALUES LESS THAN(TO_DATE(...)) COMPRESS FOR ARCHIVE,
   partition sales_1996 VALUES LESS THAN(TO_DATE(...)) COMPRESS FOR QUERY, ... );
See Also:

•"Data Block Compression" to learn about the format of compressed data blocks

•Oracle Database Administrator's Guide and Oracle Database Performance Tuning Guide to learn about table compression

•Oracle Database PL/SQL Packages and Types Reference to learn about the DBMS_COMPRESSION package for columnar compression
论坛徽章:
63
19周年集字徽章-19
日期:2020-09-23 02:43:002012新春纪念徽章
日期:2012-02-13 15:12:092012新春纪念徽章
日期:2012-01-04 11:49:54ITPUB十周年纪念徽章
日期:2011-11-01 16:20:28现任管理团队成员
日期:2011-05-07 01:45:082011新春纪念徽章
日期:2011-02-18 11:42:472011新春纪念徽章
日期:2011-01-25 15:42:562011新春纪念徽章
日期:2011-01-25 15:42:332011新春纪念徽章
日期:2011-01-25 15:42:152011新春纪念徽章
日期:2011-01-25 15:41:50
2#
发表于 2009-8-31 23:57 | 只看该作者
更细度化了.

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表