oracle是如何执行sql语句的?
比如:
select country
from table1
inner join table2 on table1.id=table2.id
where table1.name='a' and table2.name='b'
group by country
parse之后,会先执行哪一部分?
such as:
select country
from table1
inner join table2 on table1.id=table2.id
where table1.name='a' and table2.name='b'
group by country
after the parse, which part will be executed first?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
看起来您想知道Oracle选择的执行计划。您可以从 Oracle 本身获取该输出:
请参阅此处了解如何读取查询计划的说明:http://download.oracle.com/docs/cd/E11882_01/server.112/e16638/ex_plan.htm#i16971
但请注意,查询计划的选择不是固定的。 Oracle 尝试根据可用的统计数据找到当前最佳的查询计划。
It looks like you want to know the execution plan chosen by Oracle. You can get that ouput from Oracle itself:
See here for an explanation how to read a query plan: http://download.oracle.com/docs/cd/E11882_01/server.112/e16638/ex_plan.htm#i16971
Be aware however that the choice of a query plan is not fixed. Oracle tries to find the currently best query plan, based on available statistics data.
您可以在很多地方找到 SQL 的顺序执行:
但请注意,这是“理论”顺序 - SQL 引擎允许以其他顺序执行操作,前提是最终结果似乎是通过使用以上订单。
There are plenty of places you can find the order in which SQL is executed:
But note that this is the "theoretical" order - SQL engines are allowed to perform the operations in other orders, provided that the end result appears to have been produced by using the above order.
如果您安装了 Oracle 的免费工具 SQL*Developer,那么您可以单击按钮来获取解释计划。
快速解释位于 http://www.seeingwithc.org/sqltuning.html
If you install the free tool SQL*Developer from Oracle, then you can click a button to get the explain plan.
A quick explanation is at http://www.seeingwithc.org/sqltuning.html