|
原帖由 newkid 于 2009-7-3 00:47 发表 ![]()
闹了半天你是不是在说我的存储过程?我的写法运行起来到底效果怎么样?
你这种规模的应用,把所有计算逻辑放到数据库去也不会增加多少负载。一个应用服务器足矣,再多也是浪费。
你的存储过程今天有了测试结果。我把库清了测的。
time ora <sql/exseat.sql
SQL*Plus: Release 10.2.0.3.0 - Production on Fri Jul 3 15:04:59 2009
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> 2 3 4
PL/SQL procedure successfully completed.
SQL> SQL> Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
real 0m4.580s
user 0m0.012s
sys 0m0.012s
我的程序:
tuxticket@jgbticket:~> time xwfb.sh
real 0m4.071s
user 0m0.812s
sys 0m0.448s
二者都是发布了22556个席位,你的程序没有发出余额,我的有228个余额记录。速度算是差不多吧。每次执行时间都不同,离散度超过了我们的差别。
但我的程序CPU开销明显大。
因为这是一个库对库的程序,存储过程具有明显优势。
你的程序,计算量非常小,基本都是IO(<4.556),我的计算量较大,IO(<2.757)相对小一点。
[ 本帖最后由 yulihua49_cu 于 2009-7-3 15:58 编辑 ] |
|