查看 SQL 执行计划解释
最编程
2024-10-18 19:34:19
...
查看SQL执行计划 explain
explain使用方式
alter session set current_schema=test;
explain plan for +sql语句; --并不会实际执行,因此生成的执行计划也是预估的
select * from table(dbms_xplan.display);
explain使用场景
1.内存中没有谓词信息了,查看谓词信息。
2.添加hint或者改写SQL后,看预估执行计划。
3.收集完统计信息后,看新的rows评估情况。或者看不同绑定变量的评估情况。
explain查看执行计划示例
create table t1014 as select * from dba_objects;
SYS@db11g> explain plan for select object_name from t1014 where object_id<100;
Explained.
SYS@db11g> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
------------------------------------------------------------------------------
Plan hash value: 2622338484
---------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
---------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 14 | 1106 | 337 (1)| 00:00:01 |
|* 1 | TABLE ACCESS FULL| T1014 | 14 | 1106 | 337 (1)| 00:00:01 |
---------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
1 - filter("OBJECT_ID"<100)
Note
-----
- dynamic sampling used for this statement (level=2)
17 rows selected.
上一篇: 传递参数的 Soap-UI
推荐阅读
-
查看 SQL 执行计划解释
-
在 SpringBoot-MybatisPlus 项目中,在控制台中查看 sql 执行日志的方法
-
解释lsmod、lspci命令,查看网卡型号以及有关模块的信息
-
如何在 PostgreSQL 中查看过去的 SQL 语句执行记录
-
YashanDB知识库]收集分区表统计采样率小于1会导致SQL执行计划出错收集分区表统计采样率小于 1 会导致 SQL 执行计划出错
-
Oracle SQL PROFILE 摘要文件的固定执行计划详情
-
SQL Server 无法产生 FRunCM 线程。请查看 SQL Server 错误日志和 Windows 事件日志(转到)
-
最强大、最全面的蜂巢 SQL 开发人员指南,超过 40,000 字的全面解释(I)--第一部分:
-
解释执行计划之 "谜
-
缓慢的 SQL?解释 MySQL 中的分析工具