|
我这里也不出错,列存储的dml还是比较慢
SQL>CREATE VERTICAL TABLE t2
2 (
3 "SEX" INT,
4 id int,
5 "NAME" VARCHAR2(30),
6 c1 date DEFAULT sysdate,
7 c2 date DEFAULT sysdate,
8 c3 date DEFAULT sysdate,
9 c4 date DEFAULT sysdate,
10 c5 date DEFAULT sysdate,
11 c6 date DEFAULT sysdate,
12 c7 date DEFAULT sysdate
13 ) COMPRESS ;
CREATE VERTICAL TABLE t2
(
"SEX" INT,
id int,
"NAME" VARCHAR2(30),
c1 date DEFAULT sysdate,
c2 date DEFAULT sysdate,
c3 date DEFAULT sysdate,
c4 date DEFAULT sysdate,
c5 date DEFAULT sysdate,
c6 date DEFAULT sysdate,
c7 date DEFAULT sysdate
) COMPRESS ;
time used: 38.998(ms).Execute id is 4.
SQL>
SQL>declare
2 p int;
3 begin
4 for i in 1 .. 10000
5 loop
6 p:=mod(i,2);
7 insert into t2 (SEX,id,name) values(p,i,to_char(i)||'aaa');
8 end loop;
9 commit;
10 end;
11 /
declare
p int;
begin
for i in 1 .. 10000
loop
p:=mod(i,2);
insert into t2 (SEX,id,name) values(p,i,to_char(i)||'aaa');
end loop;
commit;
end;
1 rows affected
time used: 4320.450(ms).Execute id is 5.
SQL>select count(id) from t2 where id=1 ;
select count(id) from t2 where id=1 ;
COUNT(id)
1 1
1 rows got
time used: 25.148(ms).Execute id is 6.
SQL> |
|