12
返回列表 发新帖
楼主: 〇〇

xugu性能测试

[复制链接]
论坛徽章:
407
紫蛋头
日期:2012-05-21 10:19:41迷宫蛋
日期:2012-06-06 16:02:49奥运会纪念徽章:足球
日期:2012-06-29 15:30:06奥运会纪念徽章:排球
日期:2012-07-10 21:24:24鲜花蛋
日期:2012-07-16 15:24:59奥运会纪念徽章:拳击
日期:2012-08-07 10:54:50奥运会纪念徽章:羽毛球
日期:2012-08-21 15:55:33奥运会纪念徽章:蹦床
日期:2012-08-21 21:09:51奥运会纪念徽章:篮球
日期:2012-08-24 10:29:11奥运会纪念徽章:体操
日期:2012-09-07 16:40:00
11#
 楼主| 发表于 2014-4-4 18:00 | 只看该作者
没有索引,in和not in都很快
SQL>select count(*) from t1m where expr1 in(select expr1 from t1m2);

EXPR1 |
------------------------------------------------------------------------------
1048576 |

Total 1 records.

Use time:827 ms.

SQL>select count(*) from t1m where expr1 not in(select expr1 from t1m2);

EXPR1 |
------------------------------------------------------------------------------
0 |

Total 1 records.

Use time:702 ms.

使用道具 举报

回复
论坛徽章:
407
紫蛋头
日期:2012-05-21 10:19:41迷宫蛋
日期:2012-06-06 16:02:49奥运会纪念徽章:足球
日期:2012-06-29 15:30:06奥运会纪念徽章:排球
日期:2012-07-10 21:24:24鲜花蛋
日期:2012-07-16 15:24:59奥运会纪念徽章:拳击
日期:2012-08-07 10:54:50奥运会纪念徽章:羽毛球
日期:2012-08-21 15:55:33奥运会纪念徽章:蹦床
日期:2012-08-21 21:09:51奥运会纪念徽章:篮球
日期:2012-08-24 10:29:11奥运会纪念徽章:体操
日期:2012-09-07 16:40:00
12#
 楼主| 发表于 2014-4-4 18:02 | 只看该作者
exists/no exists也很快
SQL>select count(*) from t1m where exists (select 1 from t1m2 where t1m2.expr1=t1m.expr1);

EXPR1 |
------------------------------------------------------------------------------
1048576 |

Total 1 records.

Use time:734 ms.

SQL>select count(*) from t1m where not exists (select 1 from t1m2 where t1m2.expr1=t1m.expr1);

EXPR1 |
------------------------------------------------------------------------------
0 |

Total 1 records.

Use time:733 ms.

使用道具 举报

回复
论坛徽章:
407
紫蛋头
日期:2012-05-21 10:19:41迷宫蛋
日期:2012-06-06 16:02:49奥运会纪念徽章:足球
日期:2012-06-29 15:30:06奥运会纪念徽章:排球
日期:2012-07-10 21:24:24鲜花蛋
日期:2012-07-16 15:24:59奥运会纪念徽章:拳击
日期:2012-08-07 10:54:50奥运会纪念徽章:羽毛球
日期:2012-08-21 15:55:33奥运会纪念徽章:蹦床
日期:2012-08-21 21:09:51奥运会纪念徽章:篮球
日期:2012-08-24 10:29:11奥运会纪念徽章:体操
日期:2012-09-07 16:40:00
13#
 楼主| 发表于 2014-4-4 18:09 | 只看该作者
dm7好像更快
SQL>create table t as select 1 a union select 2;
操作已执行
已用时间: 102.581(毫秒). 执行号:44.
SQL>
SQL>select count(*) from
2   (select t.a from t,t t1,t t2,t t3,t t4,t t5,t t6,t t7,t t8,t t9)a,
3   (select t.a from t,t t1,t t2,t t3,t t4,t t5,t t6,t t7,t t8,t t9)b;

行号       COUNT(*)
---------- --------------------
1          1048576

已用时间: 7.118(毫秒). 执行号:45.
SQL>create table t1m as select row_number()over(order by a.a)from
2   (select t.a from t,t t1,t t2,t t3,t t4,t t5,t t6,t t7,t t8,t t9)a,
3   (select t.a from t,t t1,t t2,t t3,t t4,t t5,t t6,t t7,t t8,t t9)b;
操作已执行
已用时间: 00:00:01.132. 执行号:46.


SQL>create table t1m2 as select rownum from
2   (select t.a from t,t t1,t t2,t t3,t t4,t t5,t t6,t t7,t t8,t t9)a,
3   (select t.a from t,t t1,t t2,t t3,t t4,t t5,t t6,t t7,t t8,t t9)b;
create table t1m2 as select rownum from
(select t.a from t,t t1,t t2,t t3,t t4,t t5,t t6,t t7,t t8,t t9)a,
(select t.a from t,t t1,t t2,t t3,t t4,t t5,t t6,t t7,t t8,t t9)b;
第3 行附近出现错误[-2111]:无效的列名[ROWNUM].
SQL>create table t1m2 as select rownum expr1 from
2   (select t.a from t,t t1,t t2,t t3,t t4,t t5,t t6,t t7,t t8,t t9)a,
3   (select t.a from t,t t1,t t2,t t3,t t4,t t5,t t6,t t7,t t8,t t9)b;
操作已执行
已用时间: 730.070(毫秒). 执行号:47.
SQL>desc t1m
列名                            类型       长度       标度       是否可以为空
------------------------------- ---------- ---------- ---------- ------------
ROW_NUMBER()OVER(ORDERBYA.AASC) BIGINT     19         0          Y
SQL>desc t1m2
列名       类型       长度       标度       是否可以为空
---------- ---------- ---------- ---------- ------------
EXPR1      BIGINT     19         0          Y
SQL>drop table t1m;
操作已执行
已用时间: 131.963(毫秒). 执行号:48.
SQL>create table t1m as select row_number()over(order by a.a) expr1 from
2   (select t.a from t,t t1,t t2,t t3,t t4,t t5,t t6,t t7,t t8,t t9)a,
3   (select t.a from t,t t1,t t2,t t3,t t4,t t5,t t6,t t7,t t8,t t9)b;
操作已执行
已用时间: 00:00:01.120. 执行号:49.
SQL>select count(*) from t1m where expr1 in(select expr1 from t1m2);

行号       COUNT(*)
---------- --------------------
1          1048576

已用时间: 429.223(毫秒). 执行号:50.
SQL>select count(*) from t1m where expr1 not in(select expr1 from t1m2);

行号       COUNT(*)
---------- --------------------
1          0

已用时间: 324.660(毫秒). 执行号:51.
SQL>select count(*) from t1m where exists (select 1 from t1m2 where t1m2.expr1=t1m.expr1);

行号       COUNT(*)
---------- --------------------
1          1048576

已用时间: 303.226(毫秒). 执行号:52.
SQL>select count(*) from t1m where not exists (select 1 from t1m2 where t1m2.expr1=t1m.expr1);

行号       COUNT(*)
---------- --------------------
1          0

已用时间: 308.607(毫秒). 执行号:53.
SQL>

使用道具 举报

回复
论坛徽章:
407
紫蛋头
日期:2012-05-21 10:19:41迷宫蛋
日期:2012-06-06 16:02:49奥运会纪念徽章:足球
日期:2012-06-29 15:30:06奥运会纪念徽章:排球
日期:2012-07-10 21:24:24鲜花蛋
日期:2012-07-16 15:24:59奥运会纪念徽章:拳击
日期:2012-08-07 10:54:50奥运会纪念徽章:羽毛球
日期:2012-08-21 15:55:33奥运会纪念徽章:蹦床
日期:2012-08-21 21:09:51奥运会纪念徽章:篮球
日期:2012-08-24 10:29:11奥运会纪念徽章:体操
日期:2012-09-07 16:40:00
14#
 楼主| 发表于 2014-4-4 18:10 | 只看该作者
2个数据库对于create table as select都不要求有列名,dm用长字符串,xugu则用expr1代替

使用道具 举报

回复
论坛徽章:
43
现任管理团队成员
日期:2011-05-07 01:45:08ITPUB元老
日期:2012-09-12 14:50:28版主5段
日期:2014-06-11 02:21:31阿斯顿马丁
日期:2013-11-19 10:38:16祖母绿
日期:2012-11-06 12:43:12路虎
日期:2013-11-20 11:37:53雪佛兰
日期:2013-09-05 13:28:25ITPUB9周年纪念徽章
日期:2010-10-08 09:28:512015中国数据库技术大会纪念徽章
日期:2015-04-24 16:04:24秀才
日期:2015-05-26 13:32:07
15#
发表于 2014-4-13 16:11 | 只看该作者
〇〇 发表于 2014-4-4 18:10
2个数据库对于create table as select都不要求有列名,dm用长字符串,xugu则用expr1代替

别名其实也挺有学问的

使用道具 举报

回复
论坛徽章:
407
紫蛋头
日期:2012-05-21 10:19:41迷宫蛋
日期:2012-06-06 16:02:49奥运会纪念徽章:足球
日期:2012-06-29 15:30:06奥运会纪念徽章:排球
日期:2012-07-10 21:24:24鲜花蛋
日期:2012-07-16 15:24:59奥运会纪念徽章:拳击
日期:2012-08-07 10:54:50奥运会纪念徽章:羽毛球
日期:2012-08-21 15:55:33奥运会纪念徽章:蹦床
日期:2012-08-21 21:09:51奥运会纪念徽章:篮球
日期:2012-08-24 10:29:11奥运会纪念徽章:体操
日期:2012-09-07 16:40:00
16#
 楼主| 发表于 2014-4-19 07:27 | 只看该作者
〇〇 发表于 2014-3-29 09:24
g_max_loop_num = 100000; 存贮过程最大循环次数

改大还是不行

又收到一个版本
SQL>set g_max_loop_num to 2000000

Execute successful.

。。。
LOOP_NUM(1640000)
LOOP_NUM(1650000)
LOOP_NUM(1660000)
LOOP_NUM(1670000)
148933

Execute successful.
Use time:1165 ms.

使用道具 举报

回复
论坛徽章:
407
紫蛋头
日期:2012-05-21 10:19:41迷宫蛋
日期:2012-06-06 16:02:49奥运会纪念徽章:足球
日期:2012-06-29 15:30:06奥运会纪念徽章:排球
日期:2012-07-10 21:24:24鲜花蛋
日期:2012-07-16 15:24:59奥运会纪念徽章:拳击
日期:2012-08-07 10:54:50奥运会纪念徽章:羽毛球
日期:2012-08-21 15:55:33奥运会纪念徽章:蹦床
日期:2012-08-21 21:09:51奥运会纪念徽章:篮球
日期:2012-08-24 10:29:11奥运会纪念徽章:体操
日期:2012-09-07 16:40:00
17#
 楼主| 发表于 2014-4-19 21:17 | 只看该作者
〇〇 发表于 2014-4-19 07:27
又收到一个版本
SQL>set g_max_loop_num to 2000000

比达梦7快
SQL>call newkidi(2e6);

148933
PL/SQL 过程已成功完成
已用时间: 00:00:02.490. 执行号:43.

使用道具 举报

回复

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

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表