解答:
索引组织表:数据按主码存储和排序,同索引结构一样,不过数据直接存储于主码后面。适用于信息.检索、空间和OLAP程序。索引组织表的适用情况:
a.代码查找表。
b.经常通过主码访问的表。
c.构建自己的索引结构。
d.加强数据的共同定位,要数据按特定顺序物理存储。
e.经常用between„and„对主码或唯一码进行查询。数据物理上分类查询。如一张订单表,按日期装载数据,想查单个客户不同时期的订货和统计情况。
索引聚簇表:索引聚簇表是表相关的表共享同一数据块中的相同列,并把相关数据存储中同一个数据块上。创建索引聚簇表中最重要的是对SIZE参数有很好的估量,否则聚簇将会降低空间利用,降低效率。
使用索引聚簇表的注意点:
a如果表中数据有大量DML操作的话,那么聚簇将不适用,因为会消极地影响到DML性能。
b聚簇中,全表扫描将受到影响。这是因为将扫描聚簇中不同表的数据,额外增加很多无用的数据。
c如果经常TRUNCATE表和装载表的话,聚簇将不适用。聚簇中的表无法被TRUNCATE的,这是因为每个块中不只是存储一张表的数据。
SQL> truncate table emp;
truncate table emp
*
ERROR at line 1:
ORA-03292: Table to be truncated is part of a cluster
d如果大部分是读取操作,且通过聚簇码索引或聚簇表中其他索引来读取的话,聚簇将会比较适用。