Moving Tables
1.权限和约束都会保存
2.表结构会被保存
3.能拷贝到另外一个表空间
4.命令能并行执行
ALTER TABLE hr.employees MOVE TABLESPACE users;
Redefining a Table Online
1.可以改变表结构的存储参数
2.在同一个schema把表移到 不同的表空间
3.增加支持并行查询
4.增加或删除分区
5.重建表减小碎片
6.改变普通表的组织架构成 一个基于索引的表
7.增加或删除一列
B-Tree Indexes
重新建索引: ONLINE: 在重建的时候保持索引有效
COMPUTE STATISTICS: 手机重建索引的指标信息
Compressed Indexes
列 abcd 分别: 1234,1235,1236 存储共同的部分 123, 再存储 4,5,6
When creating the index:
CREATE INDEX emp_last_name_idx ON hr.employees(last_name, first_name) COMPRESS;
When rebuilding the index:
ALTER INDEX emp_last_name_idx REBUILD COMPRESS
Specify NOCOMPRESS(the default ) to disable key compression
ALTER INDEX emp_last_name_idx REBUILD COMPRESS(2),对前两列压缩
Reverse Key Index
Bitmap Indexes
1.用在数值情况不多的列
2.有利于多预测
3.用最少的存储空间
4.对于read-only 系统 比较实用
5.对大表有好处
B-tree vs Bitmap indexes
Index-Organized Tables
IOT 必须有主键, 不能做cluster
如果一条记录的总大小 > PCTTHRESHOLD 就放在users里
Using a Mapping Table
略
The ANALYZE Statement
1.验证结构
2.列出chained 行
3.收集指标信息(优化器不使用的) 例如:free list blocks
ANALYZE TABLE hr.employees VALIDATE STRUCTURE;