- 浏览: 80416 次
- 性别:
- 来自: 北京
最新评论
-
streamsong:
王雨尘 写道
的确是说索引是排序的,我漏掉啦
我们为什么要用索引,用索引为什么比不用索引快 -
heerwa:
...
我们为什么要用索引,用索引为什么比不用索引快 -
liulanghan110:
那么用索引为什么会提高性能呢?因为索引(以B树索引为例)是树状 ...
我们为什么要用索引,用索引为什么比不用索引快 -
王雨尘:
我们为什么要用索引,用索引为什么比不用索引快 -
pangpang514:
居然和强哥合影过。。。。佩服!
我们为什么要用索引,用索引为什么比不用索引快
关于read by other session,db file scattered read,db file sequential read等待时间的优化(上)
- 博客分类:
- oracle
今天检查彩民村的数据库健康状态,发现CPU使用率非常高,而且这个时间点的业务并不是很忙,开发人员也没有对数据库做大的操作。
分析AWR发现占用资源比较大的sql很多都是重复的
Top 5 Timed Events
Event |
Waits |
Time(s) |
Avg Wait(ms) |
% Total Call Time |
Wait Class |
CPU time |
|
20,956 |
|
51.4 |
|
read by other session |
32,208,585 |
3,680 |
0 |
9.0 |
User I/O |
db file scattered read |
32,013,721 |
2,214 |
0 |
5.4 |
User I/O |
db file sequential read |
42,658,212 |
1,100 |
0 |
2.7 |
User I/O |
latch: cache buffers chains |
945,865 |
955 |
1 |
2.3 |
Concurrency |
关于read by other session等待时间,oracle的官方文档的解释是
When information is requested from the database, Oracle will first read the data from disk into the database buffer cache. If two or more sessions request the same information, the first session will read the data into the buffer cache while other sessions wait. In previous versions this wait was classified under the "buffer busy waits" event. However, in Oracle 10.1 and higher this wait time is now broken out into the "read by other session" wait event. Excessive waits for this event are typically due to several processes repeatedly reading the same blocks, e.g. many sessions scanning the same index or performing full table scans on the same table. Tuning this issue is a matter of finding and eliminating this contention.
Oracle说产生此等待事件大部分原因是多次全扫描相同的索引或在同一表上多次全表扫描。
eygle对db file scattered read的解释是:
db file scattered read通常显示与全表扫描相关的等待。当数据库进行全表扫时,基于性能的考虑,数据会分散(scattered)读入Buffer Cache。如果这个等待事件比较显著,可能说明对于某些全表扫描的表,没有创建索引或者没有创建合适的索引。
db file sequential read通常显示与单个数据块相关的读取操作(如索引读取)。如果这个等待事件比较显著,可能表示在多表连接中,表的连接顺序存在问题,可能没有正确的使用驱动表;或者可能说明不加选择地进行索引。
在大多数情况下我们说,通过索引可以更为快速的获取记录,所以对于一个编码规范、调整良好的数据库,这个等待很大是很正常的。但是在很多情况下,使用索引并不是最佳的选择,比如读取较大表中大量的数据,全表扫描可能会明显快于索引扫描,所以在开发中我们就应该注意,对于这样的查询应该进行避免使用索引扫描。
由此可见read by other session等待时间的产生很有可能与db file scattered read和db file sequential read有关。
SQL ordered by Elapsed Time
Elapsed Time (s) |
CPU Time (s) |
Executions |
Elap per Exec (s) |
% Total DB Time |
SQL Id |
SQL Module |
SQL Text |
10,512 |
4,238 |
691 |
15.21 |
25.77 |
JDBC Thin Client |
select * from ( select this_.I... |
|
6,709 |
2,678 |
461 |
14.55 |
16.44 |
JDBC Thin Client |
select * from ( select this_.I... |
|
2,588 |
406 |
50 |
51.75 |
6.34 |
JDBC Thin Client |
select * from ( select row_.*,... |
|
2,351 |
1,133 |
134 |
17.54 |
5.76 |
JDBC Thin Client |
select this_.ID as ID3_0_, th... |
|
2,130 |
1,600 |
2,842 |
0.75 |
5.22 |
httpd@wzh4.zchw.com (TNS V1-V3) |
select t.unionorderid as seria... |
|
1,792 |
1,345 |
2,429 |
0.74 |
4.39 |
httpd@wzh4.zchw.com (TNS V1-V3) |
select t.unionorderid as seria... |
|
1,725 |
1,409 |
4,129 |
0.42 |
4.23 |
httpd@wzh4.zchw.com (TNS V1-V3) |
select ceil(count(unionorderid... |
|
1,017 |
827 |
2,429 |
0.42 |
2.49 |
httpd@wzh4.zchw.com (TNS V1-V3) |
select ceil(count(unionorderid... |
SQL ordered by CPU Ti
CPU Time (s) |
Elapsed Time (s) |
Executions |
CPU per Exec (s) |
% Total DB Time |
SQL Id |
SQL Module |
SQL Text |
4,238 |
10,512 |
691 |
6.13 |
25.77 |
JDBC Thin Client |
select * from ( select this_.I... |
|
2,678 |
6,709 |
461 |
5.81 |
16.44 |
JDBC Thin Client |
select * from ( select this_.I... |
|
1,600 |
2,130 |
2,842 |
0.56 |
5.22 |
httpd@wzh4.zchw.com (TNS V1-V3) |
select t.unionorderid as seria... |
|
1,409 |
1,725 |
4,129 |
0.34 |
4.23 |
httpd@wzh4.zchw.com (TNS V1-V3) |
select ceil(count(unionorderid... |
|
1,345 |
1,792 |
2,429 |
0.55 |
4.39 |
httpd@wzh4.zchw.com (TNS V1-V3) |
select t.unionorderid as seria... |
|
1,133 |
2,351 |
134 |
8.46 |
5.76 |
JDBC Thin Client |
select this_.ID as ID3_0_, th... |
SQL ordered by Elapsed Time
SQL ordered by CPU Time
select * from ( select this_.ID as ID3_0_, this_.ART_ID as ART2_3_0_, this_.COM_CONTENT as COM3_3_0_, this_.COM_NAME as COM4_3_0_, this_.COM_TIME as COM5_3_0_, this_.TZZ_ID as TZZ6_3_0_ from ZHCWSQ.TZZ_ARTICLE_COMMENT this_ where this_.TZZ_ID=:1 order by this_.ID desc ) where rownum <= :2 |
select * from ( select row_.*, rownum rownum_ from ( select this_.ID as ID3_0_, this_.ART_ID as ART2_3_0_, this_.COM_CONTENT as COM3_3_0_, this_.COM_NAME as COM4_3_0_, this_.COM_TIME as COM5_3_0_, this_.TZZ_ID as TZZ6_3_0_ from ZHCWSQ.TZZ_ARTICLE_COMMENT this_ where this_.ART_ID=:1 order by this_.ID desc ) row_ where rownum <= :2) where rownum_ > :3 |
发表评论
-
将博客搬至CSDN
2013-12-06 15:49 56将博客搬至CSDN -
博客地址更换通知
2012-09-29 09:23 611自2011年8月,博客使用新地址www.dbdream.org ... -
如何追踪其他SESSION会话信息
2012-02-21 20:35 1301今天测试说在加载条目数据、校验数据和质检数据的时候很慢, ... -
SHM不足导致导致数据库宕机
2012-02-21 20:17 1255今天早上到办公室,开发说测试环境应用程序挂掉,看日志说是连接不 ... -
PCTFREE和PCTUSED及将LOB存到行外
2012-02-17 11:14 1447今天的ADDM报告建议重建存放图片的表并增大PCTFREE,这 ... -
SGA_TARGET大于SGA_MAX_SIZE的真实案例
2012-02-17 11:05 1361今天在给库户数据库健康检查的时候,发现个很奇怪的问题,S ... -
利用闪回、logmnr找回误删除的数据
2011-10-25 23:54 1265朋友遇到了非常经典的ORACLE事故——误删除,开发人员告诉他 ... -
ORACLE随机取数据
2011-10-25 23:53 928目前负责的这个数字化项目,需要开发个质检工具,实现每次随机取2 ... -
oracle将一行拆分为多行
2011-10-12 00:51 2155客户的业务涉及大量的图片信息,之前这些图片信息只在数据库里存着 ... -
ORA-01034、ORA-27101和ORA-28056错误解决方法
2011-10-11 00:40 2250今天登录数据库的时候遇到了ORA-01034和ORA-2710 ... -
查看某个用户下的所有空表
2011-10-09 15:01 1059今天在群里有人问如何 ... -
SQL*LOADER加载图片、TXT
2011-10-09 15:02 1096朋友打电话问我如何利 ... -
oracle10gR2新特性--透明加密(TDE)
2011-10-09 15:02 1961从10gR2开始,oracle推出了透明数据加密技术(Tran ... -
NAMES.DIRECTORY_PATH客户端连接参数
2011-10-08 22:38 3865今天在做oracle10gR2新特性透明加密(TDE)的时候, ... -
tnsping通却连接不上数据库
2011-10-08 22:26 2440今天在Windows XP上装可个11gR2数据库,却出现个很 ... -
ORACLE字符集检查工具CSSCAN
2011-10-08 22:22 1804我们在创建数据库的时候,通常会把字符集设置为ZHS16GBK, ... -
SQL*LOADER和外部表加载
2011-10-08 22:17 1339最近一直在用SQL*LOADER加载数据,用外部表也可以实现, ... -
创建本地Duplicate数据库
2011-10-08 22:14 1036Duplicate是RMAN的一个组成部分,利用Duplica ... -
由ACOUG、云和恩墨主办的”Oracle技术嘉年华(OTN China Tour 2011)“活动已经正式拉开帷幕。
2011-09-01 12:00 792由ACOUG、云和恩墨主办的”Oracle技术嘉年华(OTN ... -
enq: TX - row lock contention
2011-07-19 17:52 1132今天,收到客户的邮件说上周每天早上10点多,数据库都会有很多锁 ...
相关推荐
数据库 等待事件Db file sequential read的介绍。The db file sequential read Oracle metric event signifies that the user process is reading buffers into the SGA buffer cache and is waiting for a physical...
db file sequential read(ms) log file parallel write(ms) log file sync(ms) db file scattered read(ms) #IO WorkLoad Oracle IOPS Oracle MBPS db file sequential read db file scattered read log file ...
buffer busy waits db file parallel write db file single write db file scattered read db file sequential read diret path write/read enqueue
队列等待之TX - allocate ITL entry引起的死锁处理 ...Db file sequential read异常等待事件分析与处理。 Db file scattered read异常等待事件分析与处理。 Direct path read异常等待事件分析与处理。
看书笔记db file scattered read DB ,db file sequential read DB,free buffer waits,log buffer space,log file switch,log file sync 我们可以通过视图v$session_wait来查看系统当前的等待事件,以及与等待事件相...
9.5.2 db file scattered read等待事件 440 9.5.3 direct path read/write(直接路径读/写) 444 9.5.4 日志文件相关等待 453 9.5.5 Enqueue(队列等待) 458 9.5.6 Latch Free(闩锁释放) 462 9.5.7 Oracle ...
Scattered Data Interpolation in Three or More VariablesScattered Data Interpolation in Three or More Variables
MATLAB 三维点云重构Surface recostruction from scattered points cloud MyCrust090209(matlab).zip
开源项目-abourget-getting-started-with-golang.zip,Installing Go tools for Sublime is scattered all around.. help me have a definitive guide.
Python分散文件
For tissue imaging,the least-scattered photons arriving at a detector may have a significant effect on the development of imaging algorithms. Tracing least-scattered photons may be helpful for ...
Static Hand Gesture Recognition with Electromagnetic Scattered Field via Complex Attention Convolutional Neural Network
The scattered intensity profiles are extracted by converting the patterns in real space into the wave vector space. Isotropic and anisotropic samples of the rough backsides of silicon wafer are ...
径向基函数 (RBF) 可用于散点数据的插值和近似,即数据不需要位于任何规则网格上。 同一个函数可以处理任何维度的数据插值。 有关更多示例,请参阅文件 rbftest.m。 1. 创建 RBF 插值使用rbf=rbfcreate(x, f); ?X...
对QAM的频谱、散图、眼图以及误码率进行了仿真。使用matlab语言。
散射系数的计算,以及散射光强分布场的计算。一整套程序
用Shepard方法实现散乱数据的曲面拟合
No tangled implicit constructions polluting your namespace and functionality scattered across multiple components. No manual management of connections. Concurrency. A single SORM instance can safely ...
Hundreds of scattered vignettes, web pages, and forums explain how to use R in particular domains. But little has been written on how to simply make R work effectively—until now. This hands-on book ...
Scattered pilot detection of CMMB signals based on data smoothing in cognitive radio networks