|
把95楼的思路实现了,汇总速度又提高1秒,印证了
http://www.itpub.net/thread-1276989-1-2.html 4楼的说法,从红黑树输出效率比从数组输出高
D:\app\instantclient10_1>..\mapc LT/LT@10.6.132.43/orcl query="select c1,c2,c3,c4,v from t" file=NUL
0 rows exported at 2010-03-13 10:35:25
recn=0
500000 rows exported at 2010-03-13 10:35:26
recn=500000
1000000 rows exported at 2010-03-13 10:35:28
output file closed at 1000000 rows.
sum=1
sum(c1+c2+c3+v)=500111497488
sum(c4)=51690810
从数据库把表读入内存3276ms
4,5,67,114,152760
申请map内存0ms
申请一层内存16ms
新建一层节点468ms,recn=1000000,每毫秒读2136行,每毫秒写2136节点
申请后面内存31ms,1000000
新建后面节点2137ms,recn=2299600,每毫秒读467行key,每毫秒写608节点
0,first=2,renc=0
1,first=1000007F,renc=1422764
2,first=20007F00,renc=1367261
3,first=30007F7F,renc=2260123
4,first=407F0000,renc=1433256
5,first=507F007F,renc=2260125
6,first=607F7F00,renc=2284775
7,first=707F7F7F,renc=2284669
8,first=8F000001,renc=1547887
9,first=9F00007F,renc=2260124
10,first=AF007F00,renc=2273610
11,first=BF007F7F,renc=2284668
12,first=CF7F0000,renc=2284776
13,first=DF7F007F,renc=2299367
14,first=EF7F7F00,renc=2299486
15,first=FF7F7F7F,renc=2284670
汇总后面节点2153ms,recn=2299600,每毫秒读464行,每毫秒写603行
Total number of rows to be inserted is 1000000
插入结果表time=5382
Total number of rows to be inserted is 1299600
插入结果表time=6302
释放所有动态内存15ms,2299600
释放所有map内存203ms,2299600
总时间14789ms,2299600
3步(读入+运算+写出)总时间18080ms
Exiting with SUCCESS status 0
D:\app\instantclient10_1>..\mapc2 LT/LT@10.6.132.43/orcl query="select c1,c2,c3,c4,v from t" file=NUL
0 rows exported at 2010-03-13 10:58:53
recn=0
500000 rows exported at 2010-03-13 10:58:54
recn=500000
1000000 rows exported at 2010-03-13 10:58:55
output file closed at 1000000 rows.
sum=1
sum(c1+c2+c3+v)=500111497488
sum(c4)=51690810
从数据库把表读入内存3385ms
4,5,67,114,152760
申请map内存0ms
申请一层内存31ms
新建一层节点468ms,recn=1000000,每毫秒读2136行,每毫秒写2136节点
申请后面内存31ms,1000000
新建后面节点1279ms,recn=2299600,每毫秒读781行key,每毫秒写1016节点
0,first=2,renc=0
1,first=1000007F,renc=1000003
2,first=20007F00,renc=1002132
3,first=30007F7F,renc=2260123
4,first=407F0000,renc=1049901
5,first=507F007F,renc=2260125
6,first=607F7F00,renc=2284775
7,first=707F7F7F,renc=2284669
8,first=8F000001,renc=1147278
9,first=9F00007F,renc=2260124
10,first=AF007F00,renc=2273610
11,first=BF007F7F,renc=2284668
12,first=CF7F0000,renc=2284776
13,first=DF7F007F,renc=2299367
14,first=EF7F7F00,renc=2299486
15,first=FF7F7F7F,renc=2284670
Total number of rows to be inserted is 1000000
插入结果表time=5226
Total number of rows to be inserted is 1299600
插入结果表time=9516
释放所有动态内存0ms,2299600
释放所有map内存187ms,2299600
总时间16926ms,2299600
3步(读入+运算+写出)总时间20326ms
Exiting with SUCCESS status 0 |
|