oracle sql Developer 中的自动跟踪
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20611208/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
AutoTrace in sql Developer
提问by Avrajit
What is the basic difference between EXPLAIN PLAN and AUTOTRACE in SQL Developer. Can anybody please elaborate?
SQL Developer 中 EXPLAIN PLAN 和 AUTOTRACE 之间的基本区别是什么。有人可以详细说明吗?
This is the query on which I am trying to get the difference inbetween Autotrace and Explain Plan.
这是我试图找出 Autotrace 和 Explain Plan 之间差异的查询。
SELECT name, address, latest_in
FROM ( SELECT name, address, latest_in
ROW_NUMBER() OVER (PARTITION BY name ORDER BY address DESC) AS rowrank
FROM avrajit
)
WHERE rowrank <> 1 AND rowrank > 3;
回答by Kris Rice
No better explanation than from Tom Kyte...
没有比 Tom Kyte 更好的解释了……
the plan from autotrace is an explain plan.
there is no statistic regarding hard parse and optimization - not sure where you are going with that, but the optimizer estimates cardinalities and those in turn with other statistics like clustering factor of indexes, blocks in tables and such - are used to derive IO estimations.
the autotrace statistics reported however are FACTS, after executing the statement, not guesses, not part of optimization.
So, autotrace used explain plan to show the plan that probably, likely will be used and autotrace shows the ACTUAL number of resources expended to execute the query.
autotrace 的计划是一个解释计划。
没有关于硬解析和优化的统计数据——不确定你要去哪里,但优化器估计基数,而那些又与其他统计数据(如索引的聚集因子、表中的块等)一起用于推导 IO 估计。
然而,报告的自动跟踪统计数据是事实,在执行语句后,不是猜测,不是优化的一部分。
因此,自动跟踪使用解释计划来显示可能会使用的计划,自动跟踪显示执行查询所花费的资源的实际数量。
Full and long thread is here: https://asktom.oracle.com/pls/asktom/asktom.search?tag=difference-of-explain-plan-autotrace-and-tkprof
完整和长线程在这里:https: //asktom.oracle.com/pls/asktom/asktom.search?tag=difference-of-explain-plan-autotrace-and- tkprof