|
前面那段引用来自于Pro Oracle SQL。
我又查阅了一下Oracle Essentials:Oracle Database 10g,3rd,里面有一段描述,但不详细:
An Oracle database issues I/O requests in two basic sizes:
Single database block I/Os
For example, one 8 KB datablock at a time. This type of request reads or writes a specific block. For example, after looking up a row in an index, Oracle uses a single block I/O to retrieve the desired database block.
Multiblock I/Os
For example, 32 database blocks, each consisting of 8 KB, for a total I/O size of 256 KB. Multiblock I/O is used for large-scale operations, such as full table scans. The number of blocks in one multiblock I/O is determined by the initialization parameter DB_FILE_MULTIBLOCK_READ_COUNT.
The Oracle database can read larger amounts of data with multiblock I/Os, so there are times when a full table scan might actually retrieve data faster than an index-based retrieval (e.g., if the selectivity of the index is low). Oracle can perform multiblock operations faster than the corresponding collection of single-block operations.
我的理解是,通过索引来查找记录,是一条一条记录(row)来读取的。当读取第一条的时候,要至少访问磁盘上的两个block(索引块和数据块),读取第二条的时候,如果index的selectivity很低,可能要继续访问磁盘上的两个块,但是如果selectivity比较高,就直接可以从cache中获得block,不涉及磁盘的IO操作。但是,无论如何,对block的访问次数是比较高的(从磁盘或者cache中)。只是猜测。。。
期待高手解惑。
[ 本帖最后由 nj21 于 2011-4-8 18:11 编辑 ] |
|