IOT (索引组织表)
IOT和堆表的不同
堆表就是我们的那些普通表,在堆表中,他们的数据存放是无序的,数据的insert也是无序的。oracle随机的把新行insert到可用数据块中~~ 但是如果说我想按照某种顺序插入数据,那么这个时候就需要使用我们IOT表
必须有主键
测试一下:
SQL> create table t_iot (object_id int primary key,object_name varchar2(60)) organization index;
Table created.
--往里面插入数据
insert into t_iot select object_id,object_name from dba_objects;
--测试性能
select * from t_iot where object_id<100;
Predicate Information (identified by operation id):
---------------------------------------------------
1 - access("OBJECT_ID"<100)
Note
-----
- dynamic sampling used for this statement (level=2)
Statistics
----------------------------------------------------------
0 recursive ca
IOT和堆表的不同
堆表就是我们的那些普通表,在堆表中,他们的数据存放是无序的,数据的insert也是无序的。oracle随机的把新行insert到可用数据块中~~ 但是如果说我想按照某种顺序插入数据,那么这个时候就需要使用我们IOT表
必须有主键
测试一下:
SQL> create table t_iot (object_id int primary key,object_name varchar2(60)) organization index;
Table created.
--往里面插入数据
insert into t_iot select object_id,object_name from dba_objects;
--测试性能
select * from t_iot where object_id<100;
Predicate Information (identified by operation id):
---------------------------------------------------
1 - access("OBJECT_ID"<100)
Note
-----
- dynamic sampling used for this statement (level=2)
Statistics
----------------------------------------------------------
0 recursive ca