How is Parameter DB_FILE_MULTIBLOCK_READ_COUNT Calculated? (Doc ID 1398860.1)

In this Document

  Goal
  Solution
  References


APPLIES TO:

Oracle Database - Enterprise Edition - Version 10.2.0.1 and later
Information in this document applies to any platform.

GOAL

This document illustrate how Oracle calculate DB_FILE_MULTIBLOCK_READ_COUNT and the internal formula used.

SOLUTION

As explained in the Oracle Documentation:

Oracle® Database Reference
12c Release 1 (12.1)
E17615-18     
DB_FILE_MULTIBLOCK_READ_COUNT

http://st-doc.us.oracle.com/12/121/server.121/e17615/refrn10037.htm#REFRN10037


DB_FILE_MULTIBLOCK_READ_COUNT is one of the parameters you can use to minimize I/O during table scans. It specifies the maximum number of blocks read in one I/O operation during a sequential scan. The total number of I/Os needed to perform a full table scan depends on such factors as the size of the table, the multiblock read count, and whether parallel execution is being utilized for the operation.

The default value of this parameter is a value that corresponds to the maximum I/O size that can be performed efficiently. This value is platform-dependent and is 1MB for most platforms.

Because the parameter is expressed in blocks, it will be set to a value that is equal to the maximum I/O size that can be performed efficiently divided by the standard block size. Note that if the number of sessions is extremely large the multiblock read count value is decreased to avoid the buffer cache getting flooded with too many table scan buffers.

Even though the default value may be a large value, the optimizer will not favor large I/Os if you do not set this parameter. It will favor large I/Os only if you explicitly set this parameter to a large value.

Online transaction processing (OLTP) and batch environments typically have values in the range of 4 to 16 for this parameter. DSS and data warehouse environments tend to benefit most from maximizing the value of this parameter. The optimizer is more likely to choose a full table scan over an index if the value of this parameter is high.

The maximum value is the operating system's maximum I/O size expressed as Oracle blocks ((max I/O size)/DB_BLOCK_SIZE). If you set this parameter to a value greater than the maximum, then Oracle uses the maximum.

From Oracle 10gR2, DB_FILE_MULTIBLOCK_READ_COUNT is automatically set depending on:

  • operating system optimal I/O size
  • the size of the buffer cache
  • the maximum number of sessions

The formula for calculating DB_FILE_MULTIBLOCK_READ_COUNT is:

db_file_multiblock_read_count = min(max I/O size/db_block_size , db_cache_size/(sessions * db_block_size))

Note: Max I/O size is platform-dependent and equal to 1MB for most platforms


As stated above, even if the value calculated by Oracle is large, the optimizer will not favour large full table scans unless DB_FILE_MULTIBLOCK_READ_COUNT is explicitly set to a large value.
It is recommended to leave the value unset so that Oracle will compute the value.

If set, the behaviour is consistent to behaviour prior to 10gR2. 
DB_FILE_MULTIBLOCK_READ_COUNT can be unset by following the information in the following note:

Document 473740.1 How To Unset DB_FILE_MULTIBLOCK_READ_COUNT to Default Value





Without WORKLOAD stats, CBO computes multiblock reads as:

io_cost = blocks/(1.6765 * db_file_multiblock_read_count  0.6581 )


With WORKLOAD stats, then:

io_cost = blocks/mbrc * mreadtim/sreadtim

REFERENCES


NOTE:1106073.1  - What is the difference between '_db_file_optimizer_read_count' and 'db_file_multiblock_read_count'?
NOTE:473740.1  - How To Unset DB_FILE_MULTIBLOCK_READ_COUNT to Default Value?

你可能感兴趣的:(How is Parameter DB_FILE_MULTIBLOCK_READ_COUNT Calculated? (Doc ID 1398860.1))