Cache characteristics of Keep pool

Source: Internet
Author: User

KEEP the pool is very simple to use, set D b_keep_cache_size value is greater than 0, you can set the buffer_pool parameter of the other object to KEEP .

ALTER TABLE T STORAGE (Buffer_pool KEEP);

SELECT COUNT (*) from T;

SELECT COUNT (*) from T;

Read from Keep pool the second time

When the keep pool is full, the newly entered table will squeeze out the memory from the front table.

All physical reading for the first query is better understood, because keep pool is t table is full, hiding this time to t2 needs to be read from the physical disk. After executing this query, it can be found that t2 table is all put in the cache, t table data is replaced as part of the block is stored in t is actually composed of physical reads, and keep pool does not work.

pool, oracle uses the least recently used algorithm, and has a structure similar to the list in memory. When db_cache fills up, oracle swaps the least-used end of the list to hold new data. And depending on the nature of the new data, choose whether to put the new data to the most used or least-used end.

DB_ When the cache is full, the index scan is performed, then oracle considers it necessary to cache the data. As a result, the least-used space is emptied, and the cached data for the index scan is stored. If it is a full table scan of a large table, then oracle considers that this data is seldom required to be accessed, Therefore, emptying the least-used space into the cached data of the table scan will still be put back to the least-used.

KEEP The pool is not using this algorithm, keep pool is actually a piece of usable memory that is accessed using a similar loop algorithm. If keep there is still space left in the pool, the new data will first use the remaining space if keep Pool is already full, keep the pool.

T The query for the table causes the full physical read. Because t2 table will t table is replaced keep , resulting in a query t table, the beginning of the data can not be found, resulting in a physical read in keep Pool replaced t table in the middle part of the data, the same reason, read to t in the middle of the table, and t table at the end of the data is replaced. Therefore, after the execution of the query found, the t table queries are all physical read, keep the contents of the pool buffer do not work.

Also, because the size of the t table exceeds the size of the KEEP pool, the data at the end of the T table is replaced with the data from the beginning, so the query for the T table is still all physically read.

through the test can be found thatCACHEoption does not work, in fact it is not difficult to understand, since put in a separateKEEPpool, then it is necessary to cache this object, soOraclefor allKEEPthe objects in the pool take the defaultCACHEthe way. And ignoring the object itself.CACHEand theNOCACHEoptions.

keep default pools have a big difference, but one thing is that they are similar: the most commonly used block is replaced with memory at the latest.

Although the KEEP pool is not using the LRU list, Oracle still considers the LRU algorithm, which is still the more common in the KEEP pool cache. the longer BLOCK retention time.


Cache characteristics of Keep pool

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.