Full oracle data access path Scan

Source: Internet
Author: User


There are only two basic ways to access oracle Data: Full scan or index scan. Statistics play a key role in the preparation of the optimizer to determine the optimal method. Www.2cto.com when a full scan is performed on an object, all data blocks related to the object must be retrieved and processed, to determine whether the data rows contained in the block are required for your query. Remember that ORACLE must read the entire data block to the memory to obtain the data row stored in this block. Therefore, when a full scan occurs, the optimizer needs to consider two things: How many data blocks must be read and how much data is discarded in each data block. Depending on the data storage method, the optimizer's execution plan may also be different. Remember, whether full scan is an efficient choice depends on the number of data blocks to be accessed and the number of final result sets. Data storage plays an important role in the decision-making process. In addition, another key factor in whether full scan is an efficient choice is to discard it. The larger the number of accessed data blocks and the number of discarded data blocks, the higher the cost of full table scan. Over time, new rows are inserted into a table, which increases the cost of dropping so many data rows, to a certain extent, the optimizer will switch to the index scan operation. The optimizer does not necessarily decide the point of the switch you want to achieve the best performance. You can use the prompt to force the optimizer to use the index to test at which point the index is more meaningful. The full scan operation reads multiple data blocks. That is to say, a single IO call will request multiple blocks, not just one. The number of data blocks requested is variable. In fact, it can be any number range from one to the specified number range by the db_file_multiblock_read_count parameter. For example, if this parameter is set to 16 and the table contains 160 blocks, you can obtain all the data blocks only after 10 calls. At www.2cto.com, you need to pay attention to the last point of full table scan. When multiple reading calls are performed on the scan, ORACLE will read the data blocks at most in the table's high water level. The high watermark mark marks the last data block with Data Writing. Even if almost all data rows are deleted and some blocks are actually completely empty, the high-water line remains unchanged. When the full scan operation is performed, all data blocks until the high level line are read and scanned, even if they are empty. This means that many empty data blocks that do not actually need to be read are also read.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.