在OLTP系统使用索引组织表IOT

索引组织表IOT
原理:所有列都存储在索引段。不再使用物理rowid,而是使用逻辑rowid。
适用场景:列数较少,复合主键,访问主键为主。

创建:
create table cities
(
  city_id number(6) not null
  ,country_id number(6) not null
  ,city varchar2(25)
  ,country varchar2(25)
  ,constraint cities_pk primary key(city_id,country_id)
)
organization index
tablespace sh
pctthreshold 40
including country_id
overflow tablespace overflow_s;

上例中,
organization index 表示创建的是索引组织表;
pctthreshold 40 表示行的长度占索引块大小超过40%将放入溢出段,溢出段在表空间overflow_s。

查询相关视图

点击(此处)折叠或打开

  1. column table_name format a15
  2. column index_name format a15
    column index_type format a15
    column pct_threshold format 99.99
    column include_column format a35
    select i.table_name,i.index_name,i.index_type,i.pct_threshold,
     nvl(column_name,'NONE') include_column
    from user_indexes i left join user_tab_columns c
    on (i.table_name = c.table_name)
    and (i.include_column = c.column_id)
    where index_type like '%IOT%';


TABLE_NAME      INDEX_NAME      INDEX_TYPE      PCT_THRESHOLD
--------------- --------------- --------------- -------------
INCLUDE_COLUMN
-----------------------------------
CITIES          CITIES_PK       IOT - TOP               40.00
COUNTRY_ID


索引组织表也需要重建以保持访问性能。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22621861/viewspace-2080362/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/22621861/viewspace-2080362/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值