您的位置:首页 > 数据库

在pl/sql 里实现index 索引 效果

2011-01-28 21:50 309 查看
-------INDEX---------

create table tb_tttt(

tid number,

tname nvarchar2(30),

tnum number

);

create sequence seq_tt

start with 1

increment by 1

maxvalue 999999

minvalue 1

cache 10;

begin

for n in 2..99999 loop

insert into tb_tttt values(seq_tt.nextval,'aaa',123);

end loop;

end;

create index tt_index on tb_tttt(tid) tablespace users;

drop index tt_index;

declare

nname nvarchar2(30);

begin

for n in 1..99429 loop

select tname into nname from tb_tttt where tid=99429;

end loop;

end;

分别两次查询,一是带索引的,一是没有索引的
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: