[bbk2864] 第55集 - Chapter 14-Using Oracle Dasta Storage Structures Efficiently(01)
Data Access Methods
To enhance performance ,you can use the following data access methods:
- Clusters
- Indexes
- B-tree(nomal or reverse key)
- Bitmap
- Function based
- Index-organized tables
- Materialized views
Clusters
Cluster Types
Hash Clustered Tables
Example
创建Index Cluster
CREATE CLUSTER mycluster(deptno number(2)) size 1024; CREATE INDEX myc_idx on CLUSTER mycluster; CREATE TABLE c_dept ( deptid number(2) primary key, dname varchar2(30), loc varchar2(30) ) CLUSTER mycluster(deptid); CREATE TABLE c_emp ( empid number primary key, ename varchar2(20), sal number, deptno number(2) references c_dept(deptid) ) CLUSTER mycluster(deptno);
CLUSTER的使用情况:
Index Cluster适合区间查询,查询性能有优势.
Index Cluster的size要科学合理设置,否则就很难发挥出cluster 的优势.
SELECT ***** FROM emp,dept WHERE emp.deptno=dept.deptno and dept.deptno=123;
这种方式奇快务必,而且事已经在物理上将两张表放在一起.
问题:创建cluster 时指定了size 1024,这个1024与db_block_size是什么关系?所有的集群表,都放在一个块上,这一块的大小尺寸1024与8k(通常DB_BLOCK_SIZE=8KB)是否矛盾?