Home Database Mysql Tutorial High Waits on 'Db File Sequential Read' Due

High Waits on 'Db File Sequential Read' Due

Jun 07, 2016 pm 03:37 PM
amp file

最近某些系统AWR的top 5中“Db File Sequential Read”占据的时间百分比非常大,通常这种等待事件是一种正常的。但当前系统性能是有些问题的,并发量大,有些缓慢,因此需要判断这种等待事件是否能够减少。MOS有几篇关于这种等待事件的介绍,这是其中一篇。

最近某些系统AWR的top 5中“Db File Sequential Read”占据的时间百分比非常大,通常这种等待事件是一种正常的。但当前系统性能是有些问题的,并发量大,有些缓慢,因此需要判断这种等待事件是否能够减少。MOS有几篇关于这种等待事件的介绍,这是其中一篇。


High Waits on 'Db File Sequential Read' Due to Table Lookup Following Index Access (文档 ID 875472.1)

即使执行计划已经是最优的了,但一次查询仍能够等待“db file sequential read'”这种事件很长的时间。通常是因为索引扫描的结果集非常大。例如:

SELECT D
FROM BIG_TABLE
WHERE A = 1253
AND B in ('CA', 'CO')
AND C > 210 ;
Copy after login

Rows    Row Source Operation
------- ---------------------------------------------------
 215431 TABLE ACCESS BY INDEX ROWID BIG_TABLE (cr=880191 pr=430780 pw=0 time=2293667056 us) 

<p></p>
<p>在大多数这样的例子中,执行查询语句在“<span>TABLE ACCESS BY INDEX ROWID</span>”上的等待要比<span>INDEX SCAN上需要更多的。这是因为随机访问表行的代价要比索引扫描更大。</span></p>
<p><span><br>
</span></p>
<p><span>为此,可以有以下几种方法调试:</span></p>
<p>1. 检查是否有更好的索引或执行计划。可能需要重新设计索引。</p>
<p>2. 尝试全表扫描。全表扫描通常比索引扫描要快,尽管CBO成本比索引扫描的成本高。</p>
<p><span>SELECT /*+ FULL(BIG_TABLE) */  D </span><br>
<span>FROM BIG_TABLE </span><br>
<span>WHERE A = 1253 </span><br>
<span>AND B in ('CA', 'CO') </span><br>
<span>AND C > 210 ;</span><br>
</p>
<p>3. 如果仅仅有很少的列出现在SELECT和WHERE子句中,可以考虑为查询创建一个复合索引避免回表。</p>
<p>例如:</p>
<p><code>CREATE INDEX <index_name> ON BIG_TABLE (A, B, C, D);</index_name></code></p>
<p><span>注意:仅针对SELECT语句有效。如果是UPDATE语句,这种做法可能没用。</span></p>
<p><span>4. 将表移动到更大block块大小的表空间。更大的block块会有更多的行,所以对减少block块IO会有帮助。重新组织表也会有帮助,因为这样做可以让索引有一个更小的clustering聚类因子。</span></p>
<p><span>5. 可以考虑增加buffer cache的大小,以至于可以缓存更多的块大小。如果表是频繁访问的,使用keep buffer池也是一个不错的选择。</span></p>
<p><span>6. 考虑使用IOT(索引组织表)。IOT可能减少IO,原因就是他会将数据存储于一个B树索引结构。例如,如果A列是表BIG_TABLE的主键,可以按照如下方法创建IOT:</span></p>
<p><span><span>create table BIG_TABLE (A number primary key, B char(2), C number, D varchar2(10))</span><span> organization index;</span></span></p>
<p><span><span>7. 如果服务器有足够的空闲资源(CPU,内存),考虑使用并行执行。这种方式不会减少IO,但是有助于降低执行时间。</span></span></p>
<p><span><span>8. 较差的磁盘IO也可能是一个原因。可以提高表所在磁盘设备的IO。这可能需要系统管理员的协助。</span></span></p>


Copy after login
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Use java's File.length() function to get the size of the file Use java's File.length() function to get the size of the file Jul 24, 2023 am 08:36 AM

Use Java's File.length() function to get the size of a file. File size is a very common requirement when dealing with file operations. Java provides a very convenient way to get the size of a file, that is, using the length() method of the File class. . This article will introduce how to use this method to get the size of a file and give corresponding code examples. First, we need to create a File object to represent the file we want to get the size of. Here is how to create a File object: Filef

How to convert php blob to file How to convert php blob to file Mar 16, 2023 am 10:47 AM

How to convert php blob to file: 1. Create a php sample file; 2. Through "function blobToFile(blob) {return new File([blob], 'screenshot.png', { type: 'image/jpeg' })} ” method can be used to convert Blob to File.

Hongmeng native application random poetry Hongmeng native application random poetry Feb 19, 2024 pm 01:36 PM

To learn more about open source, please visit: 51CTO Hongmeng Developer Community https://ost.51cto.com Running environment DAYU200:4.0.10.16SDK: 4.0.10.15IDE: 4.0.600 1. To create an application, click File- >newFile->CreateProgect. Select template: [OpenHarmony] EmptyAbility: Fill in the project name, shici, application package name com.nut.shici, and application storage location XXX (no Chinese, special characters, or spaces). CompileSDK10, Model: Stage. Device

Rename files using java's File.renameTo() function Rename files using java's File.renameTo() function Jul 25, 2023 pm 03:45 PM

Use Java's File.renameTo() function to rename files. In Java programming, we often need to rename files. Java provides the File class to handle file operations, and its renameTo() function can easily rename files. This article will introduce how to use Java's File.renameTo() function to rename files and provide corresponding code examples. The File.renameTo() function is a method of the File class.

Use java's File.getParent() function to get the parent path of the file Use java's File.getParent() function to get the parent path of the file Jul 24, 2023 pm 01:40 PM

Use java's File.getParent() function to get the parent path of a file. In Java programming, we often need to operate files and folders. Sometimes, we need to get the parent path of a file, which is the path of the folder where the file is located. Java's File class provides the getParent() method to obtain the parent path of a file or folder. The File class is Java's abstract representation of files and folders. It provides a series of methods for operating files and folders. Among them, get

Use java's File.getParentFile() function to get the parent directory of the file Use java's File.getParentFile() function to get the parent directory of the file Jul 27, 2023 am 11:45 AM

Use java's File.getParentFile() function to get the parent directory of a file. In Java programming, we often need to operate files and folders. When we need to get the parent directory of a file, we can use the File.getParentFile() function provided by Java. This article explains how to use this function and provides code examples. File class in Java is the main class used to operate files and folders. It provides many methods to obtain and manipulate file properties

Create multi-level directories using java's File.mkdirs() function Create multi-level directories using java's File.mkdirs() function Jul 24, 2023 am 11:04 AM

Create multi-level directories using Java's File.mkdirs() function In Java, we often need to create folders to store and organize files. Sometimes, we need to create multi-level directories, which are folders containing subfolders. Java provides the mkdirs() function of the File class to implement this function. The File class is a class in Java that handles files and directories. It provides a series of methods for operating files and directories. Among them, the mkdirs() function is a function that creates multi-level directories. Down

How to delete a file or directory using File.delete() method in Java? How to delete a file or directory using File.delete() method in Java? Nov 18, 2023 am 08:02 AM

How to delete a file or directory using File.delete() method in Java? Overview: In Java, we can delete a file or directory using the delete() method of the File class. This method is used to delete the specified file or directory. However, it should be noted that this method can only delete empty directories or files that are not opened by other programs. If file or directory deletion fails, you can find the specific reason by catching IOException. Step 1: Import related packages First, we need

See all articles