我想测试两个查询,以找出他们的表现,只是看着执行计划.我见过Tom Kyte一直在他的网站上这样做,以收集他的理论证据.
@H_403_8@
我相信在性能测试中存在许多缺陷,例如,当我第一次在sql开发人员中运行查询时,该查询可能返回一些公平的数字.再次运行完全相同的查询,即时返回.服务器或客户端上必须有某种缓存,我知道这很重要 – 但我只对非缓存性能感兴趣.@H_403_8@
性能测试的指导原则是什么?以及如何编写重复查询的性能测试?我只是写一个匿名的块&环?我如何获得时间信息,平均值,中位数,标准偏差?@H_403_8@
解决方法
Oracle(和其他数据库)缓存查询,您可以在其中查看所描述的行为. “硬”解析意味着查询没有查询计划,这使得Oracle可以根据索引和统计信息确定查询计划.一个“软”解析就是当你之后运行相同的查询并收到一个瞬时结果时会发生的事情,因为查询计划存在& Oracle重新使用它.见
the Ask Tom question about it for more details.
@H_403_8@
请注意07001:@H_403_8@
@H_403_8@
With the cost-based optimizer,execution plans can and do change as the underlying costs change. EXPLAIN PLAN output shows how Oracle runs the sql statement when the statement was explained. This can differ from the plan during actual execution for a sql statement,because of differences in the execution environment and explain plan environment.@H_403_8@