測試SQL Server各個版本的的效能 (轉)

worldblog發表於2007-08-17
測試SQL Server各個版本的的效能 (轉)[@more@]

  今天閒得無聊,做了一個 SERVER的各個版本的測試, 大家都知道有六個版本(企業版,標準版,個人版,開發版,Desktop Engine,SQL Server CE,企業評估版) . 我經常頭暈那個適合我開發使用 ,今天終於決定好好的拷問一下 ! 測試SQL主要考察的寫操作,讀操作,操作,各位如果有興趣 順便在你們的機器上跑跑這個指令碼 把結果貼出來?

----------------------------------------------- 
-- 我機器的(公司用機)
-----------------------------------------------
-- 賽揚4 1.7
-- 256M
-- 845D主機板 
-- NVida GeForce2 MX/MX 400 32M視訊記憶體
-- Maxtor 6E040L0 40G,7200轉
-- 英文 2000 Professional with SP4
----------------------------------------------- 
 
-----------------------------------------------
-- 測試用的SQL (注意SQL裡面的一個@iMax的變數)
-----------------------------------------------
if exists ( * from o.syss where id = object_id(N'[dbo].[AreaBak]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
 truncate table [dbo].[AreaBak]
go

--drop table  [dbo].[AreaBak]
if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[AreaBak]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
begin
CREATE TABLE [dbo].[AreaBak] (
 [AreaCode] bigint not null,
 [AreaName] [varchar] (16) COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [LocaName] [varchar] (32) COLLATE Chinese_PRC_CI_AS NOT NULL
 ) ON [PRIMARY]

ALTER TABLE [dbo].[AreaBak] WITH NOCHECK ADD
 CONSTRAINT [PK_AreaBak] PRIMARY KEY  CLUSTERED
 (
 [AreaCode]
 )  ON [PRIMARY]
end
go

declare @iMax bigint
--<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
set @iMax =1000  --<< 修改這個 iMax(1000,10000,20000,100000) 來對比測試結果 <<<<
--<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
declare @i bigint
declare @tbegin datetime
declare @tend datetime
declare @fcout float
set @tbegin = getdate()

-- 測試寫效能
set @i =1
WHILE @i=@iMax
BEGIN
  insert into AreaBak values(@i,
 rtrim(cast(@i as char(12)))+'XX',
 rtrim(cast(@i as char(12)))+'XXXX')
  set @i=@i+1
END

-- 測試索引效能
set @i = @iMax
WHILE @i >= (@iMax -50)
BEGIN
  select * from AreaBak where AreaCode = @i
  set @i=@i-1
END

-- 測試大量資料讀取效能
select * from AreaBak
set @tend = getdate()
set @fcout = convert(float,(@tend )) --24*60*60換算秒
set @fcout
print @fcout
----------------------------------------------- 

 

-----------------------------------------------
-- 中文MSDE(without SP) 測試結果(秒)
-----------------------------------------------
-- iMax = 1000 : 0.873333 | 0.88 | 0.87
-- iMax = 10000 : 8.45333 | 8.75333 | 8.32
-- iMax = 100000 : 90.9533 | 82.4467 | 83.59
-----------------------------------------------
-- 英文MSDE(with SP3) 測試結果(秒)
-----------------------------------------------
-- iMax = 1000 :  0.93|0.913333| 0.93
-- iMax = 10000 : 8.5|8.74333 |8.38333
-- iMax = 20000 :  17.0733 |16.4633|17.8067
-- iMax = 100000 : 82.9 | 82.2167 | 86.3533
-----------------------------------------------

-----------------------------------------------
-- 英文個人版(without SP) 測試結果(秒)
-----------------------------------------------
-- iMax = 1000 :  0.863333|0.87 |0.87
-- iMax = 10000 :  8.34333 | 8.25 |8.30333
-- iMax = 20000 :  16.4633 | 16.5933 |16.6633
-- iMax = 100000 :  81.27 | 86.9367 | 81.4567
-----------------------------------------------
-- 英文個人版(with SP3) 測試結果(秒)
-----------------------------------------------
-- iMax = 1000 : 0.913333 | 0.92 | 0.93 | 0.923333 | 0.913333
-- iMax = 10000 :  8.46| 8.39333 |8.87333 | 8.25333 |  8.29 |
-- iMax = 20000 :  16.9767 | 16.1933 | 16.3433  |16.2433  | 16.2867
-- iMax = 100000 :  80.4867 | 81.8767 |80.9167 | 82.09 | 81.91

-- iMax = 1000 : 0.673333/0.79/0.65(Memory被調整限制為102~255M)
-- iMax = 10000 : 8.29333/8.21/8.16333(Memory被調整限制為102~255M)
-- iMax = 100000 : 80.2267/ 80.1033 (Memory被調整限制為102~255M)

-- iMax = 100000 : 79.0433/82.24(Memory被調整限制為0~5M)
-----------------------------------------------

-----------------------------------------------
-- 英文開發版(without SP) 測試結果(秒)
-----------------------------------------------
-- iMax = 1000 : 0.863333| 0.86 | 0.85
-- iMax = 10000 : 8.14 |8.60333 | 8.26333 
-- iMax = 20000 :  17.1433 | 17.0567 | 16.3333
-- iMax = 100000 : 86.3833 | 85.7833 |86.5333
-----------------------------------------------
-- 英文開發版(with SP3) 測試結果(秒)
-----------------------------------------------
-- iMax = 1000 :  0.92|0.92| 0.923333
-- iMax = 10000 : 8.17333| 8.39333| 8.28
-- iMax = 20000 :  16.2733| 17.3033| 16.2333
-- iMax = 100000 :  86.9967 | 85.8333 | 85.2233
-----------------------------------------------

  因為操作的原因沒有測試標準版和企業版的SQL Server , 如果你只是自己開發SQL Server的應用 在自己機器上大可不必企業版 開發版(如果你不是必須用到那些特殊的功能的話) . 事實上以上的測試結果表明 : 個人版with sp3 的單機(符合我們的開發環境)綜合效能是最好.

  這個測試沒有進行併發連線處理效能的考察 , 據微軟官方稱 :當併發 5 個以上的批處理時,SQL Server 2000 個人版和 SQL Server 2000 Desktop Engine 中的併發工作負荷調控器將限制效能。

  當使用 SQL Server 2000 Desktop Engine 或 資料引擎 (MSDE) 1.0 時,資料庫的大小不能超過 2GB。(我個人經常有資料庫大於2GB,而且Desktop Engine的安裝不方便,還要加多一個圖形化管理工具的安裝.

  標準版和企業版都需要 Server版以上才可以安裝. 哼,我就是不喜歡Server版的!
 
微軟的Memory(RAM)建議:
  Enterprise Edition  64 MB of minimum, 128 MB recommended
  Standard Edition  64 MB of minimum
  Personal Edition  64 MB on Windows 2000, 32 MB on all other operating systems (對記憶體的消耗是比較小的)
  Developer Edition  64 MB of minimum 
  Desktop Engine  64 MB minimum on Windows 2000, 32 MB on all other operating systems
 
最終結論 : 我自己在開發中決定使用 SQL Server 個人版 +SP3 ,釋出的話就需要考慮客戶的規模和財力了.

 


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10752043/viewspace-963170/,如需轉載,請註明出處,否則將追究法律責任。

相關文章