BBS水木清华站∶精华区

发信人: Persi (明月天涯), 信区: Linux        
标  题: postgreSQL性能测试 (转载) 
发信站: BBS 水木清华站 (Sun Apr  4 20:43:06 1999) 
 
【 以下文字转载自 Database 讨论区 】 
【 原文由 Persi 所发表 】 
硬件条件:Pentium 100, 32M内存, 64M swap 
 
如何解释以下数据? 
还应该增加什么样的Select条件以反应postgreSQL的查询速度性能? 
从下面的数据看postgreSQL的查询速度性能如何?(比如和oracle,mySQL等 
大中型数据库比较) 
 
其中,表enterprise 56811条记录,product表110769条,都在 
code属性上建立了一个索引。(主键) 
 
�========================== 
Command: select name from enterprise 
Start At    : Sun Apr  4 20:11:54 CST 1999 
End At      : Sun Apr  4 20:12:28 CST 1999 
Time used(s): 34 
(56811 rows) 
------------------------- 
 
========================== 
Command: select code from enterprise 
Start At    : Sun Apr  4 20:12:29 CST 1999 
End At      : Sun Apr  4 20:12:59 CST 1999 
Time used(s): 30 
(56811 rows) 
------------------------- 
 
========================== 
Command: select count(name) from enterprise 
Start At    : Sun Apr  4 20:13:00 CST 1999 
End At      : Sun Apr  4 20:13:24 CST 1999 
Time used(s): 24 
(1 row) 
------------------------- 
 
========================== 
Command: select count(code) from enterprise 
Start At    : Sun Apr  4 20:13:25 CST 1999 
End At      : Sun Apr  4 20:13:49 CST 1999 
Time used(s): 24 
(1 row) 
------------------------- 
 
========================== 
Command: select code from enterprise where code='100          ' 
Start At    : Sun Apr  4 20:13:50 CST 1999 
End At      : Sun Apr  4 20:13:51 CST 1999 
Time used(s): 1 
(1 row) 
------------------------- 
 
========================== 
Command: select code from enterprise where name='100          ' 
Start At    : Sun Apr  4 20:13:51 CST 1999 
End At      : Sun Apr  4 20:14:14 CST 1999 
Time used(s): 23 
(0 rows) 
------------------------- 
 
========================== 
Command: select code from enterprise where code like '100          ' 
Start At    : Sun Apr  4 20:14:15 CST 1999 
End At      : Sun Apr  4 20:14:39 CST 1999 
Time used(s): 24 
(1 row) 
------------------------- 
 
========================== 
Command: select code from enterprise where name like '100          ' 
Start At    : Sun Apr  4 20:14:40 CST 1999 
End At      : Sun Apr  4 20:15:04 CST 1999 
Time used(s): 24 
(0 rows) 
------------------------- 
 
========================== 
Command: select code from enterprise where code like '100%' 
Start At    : Sun Apr  4 20:15:05 CST 1999 
End At      : Sun Apr  4 20:15:29 CST 1999 
Time used(s): 24 
(111 rows) 
------------------------- 
 
========================== 
Command: select code from enterprise where name like '100%' 
Start At    : Sun Apr  4 20:15:30 CST 1999 
End At      : Sun Apr  4 20:15:54 CST 1999 
Time used(s): 24 
(0 rows) 
------------------------- 
 
========================== 
Command: select code from enterprise where code like '%100%' 
Start At    : Sun Apr  4 20:15:56 CST 1999 
End At      : Sun Apr  4 20:16:20 CST 1999 
Time used(s): 24 
(217 rows) 
------------------------- 
 
========================== 
Command: select code from enterprise where code like '%100%' and name not like ' 
%100%' 
Start At    : Sun Apr  4 20:22:55 CST 1999 
End At      : Sun Apr  4 20:23:19 CST 1999 
Time used(s): 25 
(217 rows) 
------------------------- 
 
========================== 
Command: select name from product 
Start At    : Sun Apr  4 20:27:45 CST 1999 
End At      : Sun Apr  4 20:28:58 CST 1999 
Time used(s): 73 
(110769 rows) 
------------------------- 
 
========================== 
Command: select code from product 
Start At    : Sun Apr  4 20:28:59 CST 1999 
End At      : Sun Apr  4 20:30:01 CST 1999 
Time used(s): 62 
(110769 rows) 
------------------------- 
 
========================== 
Command: select count(name) from product 
Start At    : Sun Apr  4 20:30:02 CST 1999 
End At      : Sun Apr  4 20:30:51 CST 1999 
Time used(s): 49 
(1 row) 
------------------------- 
 
========================== 
Command: select count(code) from product 
Start At    : Sun Apr  4 20:30:52 CST 1999 
End At      : Sun Apr  4 20:31:40 CST 1999 
Time used(s): 48 
(1 row) 
------------------------- 
 
========================== 
Command: select code from product where code='100          ' 
Start At    : Sun Apr  4 20:31:41 CST 1999 
End At      : Sun Apr  4 20:31:42 CST 1999 
Time used(s): 1 
(1 row) 
------------------------- 
 
========================== 
Command: select code from product where name='100          ' 
Start At    : Sun Apr  4 20:31:43 CST 1999 
End At      : Sun Apr  4 20:32:28 CST 1999 
Time used(s): 45 
(0 rows) 
------------------------- 
 
========================== 
Command: select code from product where code like '100          ' 
Start At    : Sun Apr  4 20:32:28 CST 1999 
End At      : Sun Apr  4 20:33:18 CST 1999 
Time used(s): 50 
(1 row) 
------------------------- 
 
========================== 
Command: select code from product where name like '100          ' 
Start At    : Sun Apr  4 20:33:18 CST 1999 
End At      : Sun Apr  4 20:34:08 CST 1999 
Time used(s): 50 
(0 rows) 
------------------------- 
 
========================== 
Command: select code from product where code like '100%' 
Start At    : Sun Apr  4 20:34:09 CST 1999 
End At      : Sun Apr  4 20:34:58 CST 1999 
Time used(s): 49 
(1111 rows) 
------------------------- 
 
========================== 
Command: select code from product where name like '100%' 
Start At    : Sun Apr  4 20:34:58 CST 1999 
End At      : Sun Apr  4 20:35:48 CST 1999 
Time used(s): 50 
(13 rows) 
------------------------- 
 
========================== 
Command: select code from product where code like '%100%' 
Start At    : Sun Apr  4 20:35:49 CST 1999 
End At      : Sun Apr  4 20:36:38 CST 1999 
Time used(s): 49 
(1420 rows) 
------------------------- 
 
========================== 
Command: select code from product where code like '%100%' and name not like '%10 
0%' 
Start At    : Sun Apr  4 20:36:38 CST 1999 
End At      : Sun Apr  4 20:37:27 CST 1999 
Time used(s): 50 
(1420 rows) 
------------------------- 
 
-- 
※ 来源:·BBS 水木清华站 bbs.net.tsinghua.edu.cn·[FROM: venus.ihip.pku.] 

BBS水木清华站∶精华区