您好,登錄后才能下訂單哦!
剛做了個簡單的測試。
在兩臺硬件環(huán)境相同的實(shí)體機(jī)上分別裝了Timesten 11g和Oracle 11.2.0.4
在兩邊數(shù)據(jù)庫中都建立一個表
create table test(a number,b varchar2(20));
commit;
然后插入數(shù)據(jù)
declare
z number;
x varchar2(20):='abc';
begin
for z in 1..1000000 loop
insert into test values(z,x);
end loop;
end;
/
然后在oracle打開執(zhí)行計劃
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上執(zhí)行同樣操作。
create table test1(a number,b varchar2(20));
commit;
然后插入數(shù)據(jù)
declare
z number;
x varchar2(20):='abc';
begin
for z in 1..1000000 loop
insert into test1 values(z,x);
end loop;
end;
/
執(zhí)行select并查詢執(zhí)行時間
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快很多。
執(zhí)行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。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。