Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: how does oracle manage hash maps?
I hope this diagram shows up. Yahoo is not the best
for creating diagrams.
This example applies to Oracle7 and Oracle8, although in reality there may be multiple LRU chains. In Oracle8i the LRU concept is replaced by a touch-count algorithm but the idea is the same.
LRU Chain:
Most Recent Doubly linked list Least Recent
+------+------+------+ - - - -
+------+------+------+------+------+
| | | | | | PTR | | | |
Newly used buffers | We search for are placed at this end. | LRU just FREE buffers | points from this end LRUW Chain (Dirty List): | to of the LRU. +------+------+ - - +------+ | buffer Dirty buffers | | | | | | headers. are moved to +------+------+ - - +------+ | LRUW if there (Cleared by DBWR) | is room. | | Hashing is | based on DBA | modulo the | number of buckets. | A LATCH protects | each hash chain | | ,-------. --------------------------------/----------------------+ Double | Hash | <------------------------------/---------------------+ | linked | Bucket| ,--------. ,---------V----. ,--------. | | hash | 1 | ----->| Buffer |--->| Buffer |---->| Buffer |--+ | chain. `-------' <-----| Header |<---| Header |<----| Header |<---+ | 40 | | 2 | | 999 | | | | | | | |--------| | | | | |Usr|Wait| | | | | `--------' `--------------' `--------' ,-------. | | | : |SO. |--------------' | | | | | | `-------' | | Buffer Handle | | state object | | | | (actual DB blocks) | | ,-------------------. ,-------. | | | 1 | | Hash | | | | | | Bucket| | | +-------------------+ | 2 | -->... | `---------->| 2 | `-------' <--... | | | | +-------------------+ | : : | +-------------------+ : `-------------------------->| 40 Data Block | : | | +-------------------+ : : +-------------------+ ,-------. | 999 | | Hash | | | | Bucket| +-------------------+ | N | | 1000 | `-------' | | There are a PRIME +-------------------+ number of Hash buckets.
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html -----------------------------------------------------------------Received on Thu Feb 12 2004 - 23:14:48 CST
![]() |
![]() |