刚做了个简单的测试。
在两台硬件环境相同的实体机上分别装了Timesten 11g和Oracle 11.2.0.4
在两边数据库中都建立一个表
create table test(a number,b varchar2(20));
commit;
然后插入数据
declare
z number;
x varchar2(20):='abc';
begin
for z in 1..1000000 loop
insert into test values(z,x);
end loop;
end;
/
然后在oracle打开执行计划
set autot on;
SQL> select count(*) from test;
COUNT(*)
----------
1000000
Execution Plan
----------------------------------------------------------
Plan hash value: 1950795681
-------------------------------------------------------------------
| Id | Operation | Name | Rows | Cost (%CPU)| Time |
-------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 581 (7)| 00:00:07 |
| 1 | SORT AGGREGATE | | 1 | | |
| 2 | TABLE ACCESS FULL | TEST| 8725K| 581 (7)| 00:00:07 |
然后update一下,查看时间。
SQL> update test set a=123 where b='abc';
1000000 rows updated.
Execution Plan
----------------------------------------------------------
Plan hash value: 839355234
---------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
---------------------------------------------------------------------------
| 0 | UPDATE STATEMENT | | 1128K| 26M| 552 (2)| 00:00:07 |
| 1 | UPDATE | TEST | | | | |
|* 2 | TABLE ACCESS FULL| TEST | 1128K| 26M| 552 (2)| 00:00:07 |
---------------------------------------------------------------------------
在Timesten 11g上执行同样操作。
create table test1(a number,b varchar2(20));
commit;
然后插入数据
declare
z number;
x varchar2(20):='abc';
begin
for z in 1..1000000 loop
insert into test1 values(z,x);
end loop;
end;
/
执行select并查询执行时间
SQLCMDID: 33556034320
PRIVATE_COMMAND_CONNECTION_ID: 2048
EXECUTIONS: 5
PREPARES: 5
REPREPARES: 0
FREEABLE: 1
SIZE: 3912
OWNER: Shawn
QUERYTEXT: select count(*) from test1
FETCHCOUNT: 5
STARTTIME: 2014-11-18 13:22:53.263000
MAXEXECUTETIME: .1
LASTEXECUTETIME: .1
MINEXECUTETIME: 0
只有0.1s比oracle的7s快很多。
执行update并查询时间
SQLCMDID: 33556105440
PRIVATE_COMMAND_CONNECTION_ID: 2048
EXECUTIONS: 2
PREPARES: 2
REPREPARES: 0
FREEABLE: 1
SIZE: 2576
OWNER: Shawn
QUERYTEXT: update test1 set a=123 where b='abc'
FETCHCOUNT: 0
STARTTIME: 2014-11-18 13:51:18.141000
MAXEXECUTETIME: 14.044
LASTEXECUTETIME: 13.944
MINEXECUTETIME: 0
这时候问题来了!
Timesten update最快居然用了13.944秒,比oracle要慢了快一倍?
希望有大神能帮忙解答下~谢谢。刚接触Timesten。
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。