【翻译自mos文章】在tkroof 中为什么物理读要比逻辑读要多
2015-12-25 23:04
633 查看
参考自:
Why Physical Read is greater than Logical Read in Tkprof (文档 ID 211700.1)
PURPOSE
In some circumstances, you can find that tkprof report shows more physical reads than logical reads, which isn't the current result as the physical reads are normally included in logical reads.
SCOPE & APPLICATION
This article will be useful for the DBA's and customers who are concerned by the tuning of Requests.
Why Physical reads are greater than Logical reads
Sometimes, you can find the following content in tkprof report:
Physical Reads = Disk (total)
Logical Reads = Query (total) + Current (total)
call | count | cpu | elapsed | disk | query | current | rows |
------- | ------ | -------- | ---------- | ---------- | ---------- | ---------- | ---------- |
Parse | 1 | 0.67 | 1.10 | 0 | 0 | 0 | 0 |
Execute | 1 | 0.00 | 0.00 | 0 | 0 | 0 | 0 |
Fetch | 2202 | 167.48 | 678.70 | 579441 | 283473 | 17418 | 33014 |
------- | ------ | -------- | ---------- | ---------- | ---------- | ---------- | ---------- |
total | 2204 | 168.15 | 679.81 | 579441 | 283473 | 17418 | 33014 |
To find the root cause of the problem, you must generate a 10046 event trace file level 8 and check for direct read waits in it.
In 10046 raw trace, you will find "direct path read" and "direct path write" waits like the example below:
WAIT #1: nam='direct path read' ela= 10076 p1=4 p2=29035 p3=1
with P1 = file#, P2 = start block#, P3 = num blocks
The "direct path read" waits account explains the difference between logical and physical reads.
In Oracle 9.2 and above, TKProf will print waits associated with each SQL statement in the output file.
Explanation:
The reason for more physical reads than logical reads is due to the number of direct reads block access. Direct path reads are generally used by Oracle when reading directly into PGA memory (as opposed to into the buffer cache).
They may happen on different actions:
Sort IO on disk.
Read by parallel Query Slaves when scanning is done.
Blocks read by anticipation (readahead).
Such reads are done without loading blocks into the Buffer Cache. They can be single or multiblock reads.
Utilizing Direct Path Reads in this manner prevents the Oracle Buffer cache from beeing overloaded.
Oracle uses this optimisation when it considers that its not necessary to share the blocks between different sessions.
References:
Note:32951.1 Tkprof Interpretation
相关文章推荐
- 四步成为编程精英
- windows 下搭建 nodejs集成环境
- How to Install Java JDK in Kali Linux
- C# 文件的读取、写入和删除
- python general
- jsonp原来是这么回事,豁然开朗
- mathematica变分法和样条插值求解最小旋转曲面
- Sql Server 删除重复记录,只保留一条
- [MD]模仿百度手机助手动态折线图
- 【推荐系统算法】BPMF(Bayesian Probabilistic Matrix Factorization)
- json详解与介绍
- Android Fragment全解析+Fragment与Activity通信
- C# 控制台程序实现 Ctrl + V 粘贴功能
- 2015-12-25 第九天复习
- Oracle 11g RAC 二节点root.sh执行报错故障一例
- UDP主要丢包原因及具体问题分析
- tomcat、eclipse等一些问题
- 数据结构课程设计——通讯录管理系统
- 10个算法小结
- Spring依赖注入