AWR报告中经常会看到db file sequential read和db file scattered read事件。
这两个等待事件的名字确实很误导。因为他和存储I/O中的Sequential I/O和Random I/O正好相反。而Oracle则是从I/O调度的角度来命名的。
在19c文档C.3 Descriptions of Wait Events中有对两个等待事件的描述。
在老版本的文档中有对db file sequential read和db file scattered read的单独描述。
综合一下。
db file sequential read
This event shows a wait for a foreground process while doing a sequential read from the database. The I/O is generally issued as asingle I/Orequest to the OS; the wait blocks until the I/O request completes.
Wait Time: The wait time is the actual time it takes to do the I/O
- 含义:单块读(single block read)
- 典型场景:通过索引访问数据、根据 ROWID 精确取块
- 为什么叫 sequential:基于 I/O 请求是 一个一个顺序发出、等待完成;不是指磁盘顺序读。
- 实质:随机 I/O。
db file scattered read
This is the same type of event as “db file sequential read”, except that Oracle will readmultiple data blocks. Multi-block reads are typically used onfull table scans. The name “scattered read” refers to the fact that multiple blocks are read into database block buffers that are ‘scattered’ throughout memory.
Wait Time: The wait time is the actual time it takes to do all of the I/Os
- 含义:多块读(multi-block read)
- 典型场景:全表扫描、全索引扫描
- 为什么叫 scattered:多个块会读入 buffer cache,不是放在连续位置,而是分散(scatter)到不同 buffer。
- 实质:顺序 I/O(大多数情况)。
Ask TOM的帖子“Difference between “db file scatterd read” and “db file sequential read””也可以参考一下。