您好,登錄后才能下訂單哦!
剛做了個簡單的測試。
在兩臺硬件環境相同的實體機上分別裝了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進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。