51Testing软件测试论坛
标题:
oracle (2-tier)协议SQL语句响应时间的问题
[打印本页]
作者:
lingyun1104
时间:
2008-6-17 14:58
标题:
oracle (2-tier)协议SQL语句响应时间的问题
SQL:
select count(*) recordCount from (select * from CONTA_ENTER_TBL where
DEPOT_COMPANY_ID = '661'
and CONTA_in_DATE >=to_date('2002-05-16 00:00','yyyy-mm-dd hh24:mi:ss') and CONTA_in_DATE <=to_date('2008-06-16 00:00','yyyy-mm-dd hh24:mi:ss')
and DEL_MARK = 0 and RECORD_TYPE=1
)
上面的SQL语句在TOAD中执行需要13秒
在LOADRUNNER中选择oracle (2-tier)协议,录制该SQL的脚本如下:
lr_start_transaction("counter");
lr_think_time(20);
lrd_ora8_handle_alloc(OraEnv1, STMT, &OraStm19, 0);
lrd_ora8_attr_set(OraStm19, PREFETCH_ROWS, "0", -1, 0);
lrd_ora8_attr_set(OraStm19, PREFETCH_MEMORY, "0", -1, 0);
lrd_ora8_stmt(OraStm19, "select count(*) recordCount from (select * from CONTA_ENTER_TBL "
"where \nDEPOT_COMPANY_ID = '661' \nand CONTA_in_DATE >="
"to_date('2002-05-16 00:00','yyyy-mm-dd hh24:mi:ss') and "
"CONTA_in_DATE <=to_date('2008-06-16 00:00','yyyy-mm-dd hh24"
":mi:ss') \nand DEL_MARK = 0 and RECORD_TYPE=1 \n)", 1, 0, 0);
lrd_ora8_exec(OraSvc1, OraStm19, 0, 0, &uliRowsProcessed, 0, 0, 0, 0,
0);
lr_end_transaction("counter",LR_AUTO);
问题是:
在回放或者在并发操作得出的响应时间是:0.058秒,而在TOAD中执行时它是13秒,相差为什么那么大呢?到底哪个时间是准确的呢?请诸位大侠帮忙解释一下。
作者:
nelsonhan
时间:
2008-6-18 21:33
oracle执行是有缓存的,第一次以外的运行因为缓存的关系速度会大大加快,会不会是这个原因
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2