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
markedfor deletion. However, under Committed Read, no lock is placed on
anundeleted row when it is read. BYTE or TEXT data is read in a second step,
after the row has been fetched. During this lengthy step, it is possible for
anotherprogram to delete the row and commit the deletion and for the space
onthe disk page to be reused. If the space has been reused in the interim, 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 thelock table, the active tblspace
table, and thebuffer table.
Eachentry that is to be placed in any OnLine table has a unique key. If a hash
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 may map onto the same hash value. Entries are stored by their
hash value and not solely by their unique key value.
Forexample, a simple hashing algorithm is “divide the key value by 100 and
usethe remainder.” With this algorithm, you could expect 100 different 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 hash value is computed. Using this hash value, the entry 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.