Home Database Mysql Tutorial 实验讲解DB_FILE_MULTIBLOCK_READ_COUNT对物理读和IO次数的影响

实验讲解DB_FILE_MULTIBLOCK_READ_COUNT对物理读和IO次数的影响

Jun 07, 2016 pm 04:03 PM
file read experiment explain

当执行SELECT语句时,如果在内存里找不到相应的数据,就会从磁盘读取进而缓存至LRU末端(冷端),这个过程就叫物理读。当相应数据已在内存,就会逻辑读。 物理读是磁盘读,逻辑读是内存读;内存读的速度远比磁盘读来得快。 参数db_file_multiblock_read_coun

当执行SELECT语句时,如果在内存里找不到相应的数据,就会从磁盘读取进而缓存至LRU末端(冷端),这个过程就叫物理读。当相应数据已在内存,就会逻辑读。

物理读是磁盘读,逻辑读是内存读;内存读的速度远比磁盘读来得快。 

参数db_file_multiblock_read_count=N,会决定在全表扫描或索引全扫描时单次IO最大读取N个数据块。 

下在结合实验来讲解物理读: 

创建测试表: 

create table t3 as select * from dba_segments tablespace users;

对测试表进行统计信息收集: 

begin
dbms_stats.gather_table_stats(ownname => 'SYS',tabname => 'T3',cascade => true);
end; 

查看T3表的相关信息:

select * from dba_tables where table_name='T3'
\

数据分布在100个数据块 

修改参数

SQL> alter session set db_file_multiblock_read_count=1

对T3表全扫描

\

可以看到,T3全扫描过程读取了101个数据块,同时引起103内存读(包括当前读和一致读)

截取这个步骤的AWR信息

\

db_file_multiblock_read_count=1的情况下,查询T3全表数据期间发生100.3个数据块的物理读,IO次数为100.3次。

\

USERS表空间的user01.dbf数据文件发生了101次读操作

 

增大db_file_multiblock_read_count之后

SQL> alter session set db_file_multiblock_read_count=128;

Session altered.

SQL> alter system flush buffer_cache;

查询表T3

\

物理读依旧101,逻辑读也相应改变

\

USERS表空间users01.dbf数据文件读次数降为15次

同样的数量的数据块物理读,如果单次读取的数据块越多,那么IO次数就越少,系统性能则越好。

-------------------------------------------------------------------------------------------------

本文来自于我的技术博客 http://blog.csdn.net/robo23

转载请标注源文链接,否则追究法律责任!

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

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

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.

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.

Will human trials be scrapped? Musk's Neuralink faces federal investigation, experimental animals die frequently Will human trials be scrapped? Musk's Neuralink faces federal investigation, experimental animals die frequently Apr 12, 2023 pm 05:37 PM

Last week, Musk held Neuralink’s Show & Tell demonstration event to show the world the latest progress in brain-computer interfaces. At the meeting, Musk said that it is very difficult to go from prototype to production and faces many challenges. Neuralink has been working hard to initiate human trials and has submitted all the necessary documentation to the FDA to begin human trials. Musk estimates that the first Neuralink device could be in the human brain within 5-6 months. At the meeting, Musk emphasized that Neuralink respects animal subjects and that brain-computer interface devices have undergone extensive benchmark testing before being implanted in animals. Two monkeys Pager and

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

How to use the Linux read command and read file contents How to use the Linux read command and read file contents Feb 24, 2024 pm 08:51 PM

[How to use the Linux read command to read file contents] In Linux systems, read is a command used to read data from standard input or files. Using the read command can help users quickly obtain the file content and perform subsequent processing. The following will introduce in detail how to use the Linuxread command to read file contents, including specific code examples. Reading the file content To read the file content, you first need to open a terminal and use the following command format to read the file content: read[-

See all articles