如何查看Oracle中的SQL执行计划? [英] How can I see the SQL execution plan in Oracle?

查看:77
本文介绍了如何查看Oracle中的SQL执行计划?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在正在学习数据库索引,并且试图了解使用它们的效率.

I'm learning about database indexes right now, and I'm trying to understand the efficiency of using them.

  • 我想查看特定查询是否使用索引.
  • 我想真正了解使用索引执行查询与不使用索引执行查询之间的区别(所以我想查看查询的执行计划).

我正在使用 sql + .

如何查看执行计划,以及在哪里可以找到告诉我是否使用索引的信息?

How do I see the execution plan and where can I found in it the information telling me whether my index was used or not?

推荐答案

尝试使用此代码先进行解释,然后查看计划:

Try using this code to first explain and then see the plan:

说明计划:

explain plan 
for 
select * from table_name where ...;

查看计划:

select * from table(dbms_xplan.display);

去掉了括号

这篇关于如何查看Oracle中的SQL执行计划?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆