
2-46 IBM Informix OnLine Database Server Administrator’s Guide
Managing Shared-Memory Resources
If a program is using Committed Read isolation, the problem just described
cannot occur since the database server does not see a row that has been
marked for deletion. However, underCommitted Read, nolock is placed on
an undeleted row when itis read. BYTE or TEXT data isreadin a secondstep,
after the row has been fetched. During this lengthy step, it is possible for
anotherprogramtodeletetherowandcommitthedeletionandforthespace
on the diskpage tobe reused. If thespace hasbeen reused in theinterim, the
blob timestamp will have been incremented and will be greater than the
timestamp in the forward pointer. In this case, the comparison will indicate
the obsolete pointer information and the inconsistency will be reported as a
part of consistency checking.
Hash Tables and the Hashing Technique
Hashing is a technique that permits rapid lookup in tables where items are
added unpredictably. Three OnLine shared-memory tables have an
associated hash table. These three tables are the lock table, the active tblspace
table, and the buffer table.
Eachentry that istobeplaced in any OnLinetablehasa unique key. Ifahash
table is used, then the unique key is “hashed,” which means a specific
algorithm is used to map the keys onto a set of integers, which are the hash
values. The algorithm is selected so that the keys, once hashed, are fairly
evenly distributed over a range. The result is not a unique mapping; two
differentkeys maymaponto thesamehash value.Entriesarestoredby their
hash value and not solely by their unique key value.
For example, asimplehashing algorithm is“dividethe key valueby100 and
use the remainder.” With thisalgorithm, youcould expect 100different hash
values equal to each possible remainder, from 0 to 99. Each of these hash
values would correspond to an entry in the hash table.
To locate an item in the table, the item key is passed through the hashing
algorithmand its hashvalueis computed. Usingthis hash value,theentry at
that location in the hash table is examined.
Each hash-table entry contains a pointer to entries in the associated table
(lock, tblspace, or user) with the corresponding hash value. Multiple entries
with the same hash value are chained together in a linked list.
Komentarze do niniejszej Instrukcji