Oracle logical read

Source: Internet
Author: User

We all know that data blocks are the most basic read/write units in oracle, but the data you need is not the whole block, but the rows or columns in the block. when a user issues an SQL statement, the statement is parsed and executed, and the data capture phase begins. In this phase, the server process first reads the data block of the row from the data file into the buffer cache. This process is called physical read. each read block is a physical read. when a block is sent to the buffer cache, the block cannot be sent to the user immediately, because what the user needs is not the entire block, but the row in the block. the process of reading rows from buffer cache blocks is logical reading. to complete a logical read, the server process first needs to find the cache buffer chain of the block in the hash table. after finding the block, you need to add a cache buffer chains latch to the chain. After the block is successfully added, search for the specified block in the chain and add a pin lock to the block. and release the cache buffer chains. then you can access the rows in the block. the server process does not fetch all the rows that meet the condition in the block once, but retrieves a certain number of rows each time based on your capture command. after these rows are extracted, they are transmitted to the client user Through PGA. once the row is removed from the buffer cache, the session needs to release the PIN added to the block. this logical read ends. if you want to capture the remaining lines in the block, the server process will apply for a cache bufffer link again. add PIN to the block again. this is even another logical read. that is to say, each time a server process applies for a cache buffer chock, it is a logical read. the number of rows read by each logical read can be set in the capture command.
Logical read is closely related to the Cache buffer chains latches. TOM once mentioned that each time a process applies for a Cache buffer chains latch, it is a logical read. However, logical read is not equivalent to the Cache buffer chains latches. Each logical read requires at least two Cache buffer chains latches in 9i. Logical read refers to the process of locating blocks in the Hash table.

Author "smart"
 

Related Article

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.