oracle11gR2 table compress一點測試
11gR2中,有兩種壓縮,一種是普通的壓縮compress,另一種是compress for oltp.
普通的compress對後面的insert進來的資料似乎壓縮不大
compress for oltp對後面insert進來的資料壓縮比例比較明顯
SQL> select * from v$version where rownum<2;
BANNER
-------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
SQL> create table tt as select * from all_objects;
Table created.
Elapsed: 00:00:01.02
SQL> create table tt_cm compress as select * from all_objects;
Table created.
Elapsed: 00:00:00.79
SQL> create table tt_oltp compress for oltp as select * from all_objects;
Table created.
Elapsed: 00:00:00.93
SQL> exec dbms_stats.gather_table_stats('test','tt');
PL/SQL procedure successfully completed.
Elapsed: 00:00:01.80
SQL> exec dbms_stats.gather_table_stats('test','tt_cm');
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.76
SQL> exec dbms_stats.gather_table_stats('test','tt_oltp');
PL/SQL procedure successfully completed.
SQL> select table_name,pct_free,num_rows,blocks,empty_blocks,avg_space,avg_row_len,compression,compress_for from user_t
bles;
TABLE_NAME PCT_FREE NUM_ROWS BLOCKS EMPTY_BLOCKS AVG_SPACE AVG_ROW_LEN COMPRESSION COMPRESS_F
---------- ---------- ---------- ---------- ------------ ---------- ----------- ---------------- ----------
TT 10 11197 158 0 0 88 DISABLED
TT_CM 0 11198 52 0 0 88 ENABLED BASIC
TT_OLTP 10 11199 58 0 0 88 ENABLED OLTP
SQL> select segment_name,bytes,blocks,extents from user_segments order by segment_name;
SEGMENT_NAME BYTES BLOCKS EXTENTS
-------------------- ---------- ---------- ----------
TT 2097152 256 17
TT_CM 458752 56 7
TT_OLTP 524288 64 8
-------=======================================================
SQL> insert into tt select * from all_objects;
11199 rows created.
Elapsed: 00:00:01.62
SQL> commit;
Commit complete.
Elapsed: 00:00:00.00
SQL> insert into tt_cm select * from all_objects;
11199 rows created.
Elapsed: 00:00:01.58
SQL> insert into tt_oltp select * from all_objects;
11199 rows created.
Elapsed: 00:00:04.75
SQL> commit;
Commit complete.
Elapsed: 00:00:00.00
SQL> exec dbms_stats.gather_table_stats('test','tt_oltp');
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.28
SQL> exec dbms_stats.gather_table_stats('test','tt_cm');
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.20
SQL> exec dbms_stats.gather_table_stats('test','tt');
PL/SQL procedure successfully completed.
SQL> select table_name,pct_free,num_rows,blocks,empty_blocks,avg_space,avg_row_len,compression,compress_for from user_ta
bles
2 ;
TABLE_NAME PCT_FREE NUM_ROWS BLOCKS EMPTY_BLOCKS AVG_SPACE AVG_ROW_LEN COMPRESSION COMPRESS_F
---------- ---------- ---------- ---------- ------------ ---------- ----------- ---------------- ----------
TT 10 22396 382 0 0 88 DISABLED
TT_CM 0 22397 250 0 0 88 ENABLED BASIC
TT_OLTP 10 22398 124 0 0 88 ENABLED OLTP
Elapsed: 00:00:00.03
SQL> select segment_name,bytes,blocks,extents from user_segments order by segment_name;
SEGMENT_NAME BYTES BLOCKS EXTENTS
-------------------- ---------- ---------- ----------
TT 3145728 384 18
TT_CM 2097152 256 17
TT_OLTP 1048576 128 16
-----============================================================
select dbms_rowid.rowid_relative_fno(rowid),dbms_rowid.rowid_block_number(rowid),count(*) from tt_OLTP
group by dbms_rowid.rowid_relative_fno(rowid),dbms_rowid.rowid_block_number(rowid)
order by 2
查詢tt_cm table得出,後面insert進來的資料,每個資料塊裡面的存放資料的記錄,都少了。
tt_oltp,後面insert進來的資料,都有一定的壓縮。
alter table tt_cm_t compress 之後,需要對tt_cm_t進行
alter table tt_cm_t move才能壓縮。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24237320/viewspace-741741/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 有關oracle external table的一點測試。Oracle
- DBMS_REDEFINITION.COPY_TABLE_DEPENDENTS的一點測試
- Oracle Table and tablespace CompressOracle
- oracle11gR2 RAC 環境測試修改節點VIP的測試操作記錄Oracle
- Oracle exp中compress引數的影響測試Oracle
- cursor express的一點測試!Express
- Oracle11gR2 Smart Flash Cache測試說明Oracle
- 測試流程與測試人員配置的一點感想
- 今天測試了一下update partition table的part key
- mv(materialized view)的一點測試ZedView
- Index Joins的一點測試!Index
- 軟體測試流程的一點感悟
- index clusterring cluster的一點測試!Index
- redis測試點Redis
- GoldenGate "Error mapping from table.a to table.a"錯誤測試GoErrorAPP
- oracle10g_alter table_測試3Oracle
- 軟體穩定性測試的測試點
- 有關lock的一點測試總結!
- 許可權傳遞的一點測試!
- 測試的思考點
- 最全APP測試思想及流程要點,高薪測試人員一定要看!APP高薪
- nested loops 和hash join的一點測試OOP
- sys_refcursor以及cursor express的一點測試!Express
- 引數SKIP_UNUSABLE_INDEXES的一點測試!Index
- (一)效能測試(壓力測試、負載測試)負載
- App測試、Web測試和介面測試一般測試流程APPWeb
- APP測試設計測試用例的要點APP
- 功能測試點總結
- ios APP 測試思考點iOSAPP
- [Oracle] Create table as 速度測試nologging+parallelOracleParallel
- 測試alter table storage及dbms_space_admin包
- 主子表drop table constraints cascade的測試AI
- 認真一點學 Go:19. 單元測試Go
- 基於函式index的一點簡單測試!函式Index
- 行連線的一點內部儲存測試!
- fast_start_parallel_rollback引數的一點測試ASTParallel
- 介面測試用例編寫和測試關注點
- 軟體測試中的43個功能測試點(上)