这个sql脚本里的using index的作用是什么?

[复制链接]
查看11 | 回复2 | 2005-10-30 17:05:33 | 显示全部楼层 |阅读模式
create table T_SP_SERVICE_ACCESSLIST
(
FID
NUMBER(20) not null,
FUSERID NUMBER(20) not null,
FSERVICEIDNUMBER(20) not null,
FLASTACCESSTIME TIMESTAMP(6) not null
)
tablespace PLATFORM_DEV
pctfree 10
initrans 5;
--临时sequence
create sequence SEQ_TMP_ACCESSLISTstart with 1;
insert into t_sp_service_accesslist
(fid, fuserid, fserviceid, flastaccesstime)
select SEQ_TMP_ACCESSLIST.Nextval fid,
a.fuserid,
a.fserviceid,
a.flastaccesstime
from (select fuserid,

t.fserviceid fserviceid,

max(t.flastaccesstime) flastaccesstime

from t_sp_accesslog t
group by fuserid, t.fserviceid) a

update t_common_sequence cs
set cs.fmaxvalue = SEQ_TMP_ACCESSLIST.Nextval + 10000
where ftype = 'T_SP_SERVICE_ACCESSLIST';
-- Create/Recreate primary, unique and foreign key constraints
alter table T_SP_SERVICE_ACCESSLIST
add primary key (FID)
using index
tablespace PLATFORM_DEV
pctfree 20
initrans 10;
create unique index idx_uk_user_serviceid on T_SP_SERVICE_ACCESSLIST (fuserid, fserviceid);
drop sequence SEQ_TMP_ACCESSLIST;
请教下using index的作用是什么
回复

使用道具 举报

千问 | 2005-10-30 17:05:33 | 显示全部楼层
using index tablespace PLATFORM_DEV
要连着读
回复

使用道具 举报

千问 | 2005-10-30 17:05:33 | 显示全部楼层
using index tablespace用来指定索引存放的表空间,通常情况下索引和数据分别放在不同的表空间中,便于维护和管理
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行