|
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秒,相差为什么那么大呢?到底哪个时间是准确的呢?请诸位大侠帮忙解释一下。 |
|