|
11gr2测试
C:\Documents and Settings\Administrator>sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on 星期二 4月 6 16:56:53 2010
Copyright (c) 1982, 2010, Oracle. All rights reserved.
连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> create user lt identified by LT default tablespace users;
用户已创建。
SQL> grant create session ,dba to lt;
授权成功。
SQL> conn lt/LT
已连接。
SQL> set lines 132 pages 50000
SQL> create table t(c1 number(2,0),c2 number(2,0),c3 number(3,0),c4 number(3,0),v number(12,0))compress;
表已创建。
SQL> set timi on
SQL> insert into t select mod(level,4)c1,mod(level,5)c2,mod(level,67)c3,
2 mod(case when mod(level,13)>0 then level end ,113)c4, level v from dual connect by level<=1E6;
已创建1000000行。
已用时间: 00: 00: 15.20
SQL> select sum(bytes)/power(2,20) from user_segments where segment_name='T';
SUM(BYTES)/POWER(2,20)
----------------------
22
已用时间: 00: 00: 00.29
SQL> create table tcube (c1 number(2,0),c2 number(2,0),c3 number(3,0),c4 number(3,0),sv number(18,0),cv number(12,0),gid number(2,0))compres
s;
表已创建。
已用时间: 00: 00: 00.04
SQL> insert into tcube select c1,c2,c3,c4,sum(v)sv,count(v)cv,grouping_id(c1,c2,c3,c4)gid from t group by cube(c1,c2,c3,c4);
已创建234600行。
已用时间: 00: 00: 32.11
SQL> commit;
提交完成。
已用时间: 00: 00: 00.01
SQL> create table yourcube (c1 number(2,0),c2 number(2,0),c3 number(3,0),c4 number(3,0),sv number(18,0),cv number(12,0),gid number(2,0))comp
ress;
表已创建。
已用时间: 00: 00: 00.06
D:\app>cl /O2 mapc4chd4.cpp /link oci.lib
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
mapc4chd4.cpp
Microsoft (R) Incremental Linker Version 6.00.8168
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
/out:mapc4chd4.exe
oci.lib
mapc4chd4.obj
D:\app>mapc4chd4 LT/LT@10.6.99.65/orcl query="select * from t" file=NUL
0,1 1,1 2,1 3,1 4,4
0 rows exported at 2010-04-07 09:26:42
recn=0
500000 rows exported at 2010-04-07 09:26:45
recn=500000
1000000 rows exported at 2010-04-07 09:26:47
output file closed at 1000000 rows.
sum=1
sum(c1+c2+c3+v)=500036999500
sum(c4)=51690810
从数据库把表读入内存4812ms
4,5,67,114,152760
申请map内存0ms
申请一层内存15ms
新建一层hashmap节点563ms,recn=152760,每毫秒读1776行,每毫秒写271节点
申请后面内存0ms,152760
gid=1 found 0 time
新建后面节点[1],recn=225822
新建后面节点[2],recn=226392
新建后面节点[3],recn=226392
新建后面节点[4],recn=234600
新建后面节点[5],recn=234600
新建后面节点[6],recn=234600
新建后面节点203ms,recn=234600,每毫秒读752行key,每毫秒写403节点
malloc time=0ms
let time=172ms
Initializing the environment..
Logged on as LT
col0:c1 3 1
col1:c2 3 1
col2:c3 3 1
col3:c4 3 1
col4:cv 3 4
col5:sv 1 14
col6:gid 3 1
time=266ms
col_ary_rows=4096,col_ary_cols=7
2760all time=1703ms
插入结果表152760行
malloc time=0ms
let time=109ms
col0:c1 3 1
col1:c2 3 1
col2:c3 3 1
col3:c4 3 1
col4:cv 3 4
col5:sv 1 14
col6:gid 3 1
time=125ms
col_ary_rows=4096,col_ary_cols=7
840all time=938ms
插入结果表81840行
释放所有动态内存0ms,234600
释放所有map内存62ms,234600
总时间3515ms,234600
3步(读入+运算+写出)总时间8359ms
Exiting with SUCCESS status 0
SQL> select * from (select * from tcube minus select * from yourcube);
未选定行
已用时间: 00: 00: 03.17
|
|