-- Create table
create table COM_NFXD_MZUSER
(
PHONE VARCHAR2(100) not null,
CELL VARCHAR2(50),
DONE VARCHAR2(4000) default (0),
SCORE NUMBER(19) default (0) not null,
ISZJ NUMBER(1) default (0),
GATENUM NUMBER(19) default (0)
)
tablespace IVR_DATA
pctfree 10
pctused 40
initrans 1
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
-- Create/Recreate primary, unique and foreign key constraints
alter table COM_NFXD_MZUSER
add primary key (PHONE)
using index
tablespace IVR_DATA
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
下面的SQL 语句优化
select phone,score from (select
distinct(score),substr(phone,length(phone)-3,4) as phone from
com_nfxd_mzuser order by score desc) where rownum<4
create table COM_NFXD_MZUSER
(
PHONE VARCHAR2(100) not null,
CELL VARCHAR2(50),
DONE VARCHAR2(4000) default (0),
SCORE NUMBER(19) default (0) not null,
ISZJ NUMBER(1) default (0),
GATENUM NUMBER(19) default (0)
)
tablespace IVR_DATA
pctfree 10
pctused 40
initrans 1
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
-- Create/Recreate primary, unique and foreign key constraints
alter table COM_NFXD_MZUSER
add primary key (PHONE)
using index
tablespace IVR_DATA
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
下面的SQL 语句优化
select phone,score from (select
distinct(score),substr(phone,length(phone)-3,4) as phone from
com_nfxd_mzuser order by score desc) where rownum<4
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货