当前位置:网站首页>Oracle数据库 SQL语句执行计划、语句跟踪与优化实例
Oracle数据库 SQL语句执行计划、语句跟踪与优化实例
2022-07-03 09:09:00 【drhrht】

如何发现最消耗系统资源的SQL语句呢 利用I/O优化鉴定耗费资源的方法即AWR报告,即可使之变得很容易。
当确定了一个最有可能出问题的 SQL 语句后,接下来就是如何追踪这一语句的执行,最普遍的方法就是找出该SQL语句的执行计划。
随着数据库中数据的增加,系统的响应速度就成为目前系统需要解决的主要问题之一,系统优化中一个很重要的方面就是SQL语句的优化。
大量的数据指出劣质的SQL语句和优质的SQL语句之间的速度差别可以达到上百倍,对一个系统不是简单的能实现功能就可以,而是要写出高质量的SQL语句提高系统的可用性。
01、 利用autotrace追踪SQL语句
利用autotrace追踪SQL语句的代码如下:
SQL> set autotrace on
SQL> select * from dual;
D
-
X
执行计划
----------------------------------------------------------
Plan hash value: 272002086
--------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
--------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 2 | 2 (0)| 00:00:01 |
| 1 | TABLE ACCESS边栏推荐
- Shell logic case
- Learning C language from scratch -- installation and configuration of 01 MinGW
- Flink learning notes (10) Flink fault tolerance mechanism
- Nodemcu-esp8266 development (vscode+platformio+arduino framework): Part 1 -- establishment of engineering template -template
- 一款开源的Markdown转富文本编辑器的实现原理剖析
- Leetcode daily question (516. long palindromic subsequence)
- Schematic diagram and connection method of six pin self-locking switch
- PolyWorks script development learning notes (II) -treeview basic operations
- [CSDN]C1训练题解析_第二部分_Web基础
- Development of fire power monitoring system
猜你喜欢

MySQL data manipulation language DML common commands

Leetcode daily question (2090. K radius subarray averages)

Code word in NR

SSB Introduction (PbCH and DMRs need to be supplemented)
![[CSDN]C1训练题解析_第三部分_JS基础](/img/b2/68d53ad09688f7fc922ac65e104f15.png)
[CSDN]C1训练题解析_第三部分_JS基础

Nr-prach: access scenario and access process

Flink learning notes (VIII) multi stream conversion

Solve the problem of disordered code in vscode development, output Chinese and open source code

【22毕业季】我是毕业生yo~

Fundamentals of Electronic Technology (III)__ Logic gate symbols in Chapter 5
随机推荐
Flink learning notes (10) Flink fault tolerance mechanism
STM32 interrupt priority management
Schematic diagram and connection method of six pin self-locking switch
Nodemcu-esp8266 development (vscode+platformio+arduino framework): Part 2 --blinker_ Hello_ WiFi (lighting technology - Mobile App control routine)
Failed building wheel for argon2 cffi when installing Jupiter
LeetCode每日一题(2232. Minimize Result by Adding Parentheses to Expression)
Find all possible recipes from given supplies
Solve the problem of disordered code in vscode development, output Chinese and open source code
MYSQL数据库底层基础专栏
Win10安装ELK
2021-09-26
numpy. Reshape() and resize() functions
All processes of top ten management in project management
Shell logic case
Install local sources using yum
Error output redirection
UCI and data multiplexing are transmitted on Pusch (Part VI) -- LDPC coding
Global KYC service provider advance AI in vivo detection products have passed ISO international safety certification, and the product capability has reached a new level
Directory and switching operation in file system
LeetCode每日一题(745. Prefix and Suffix Search)