The aim of pointer swizzling is to optimize access to objects. As we have just mentioned,
references between objects are normally represented using OIDs. If we read an object from
secondary storage into the page cache, we should be able to locate any referenced objects
on secondary storage using their OIDs. However, once the referenced objects have been
read into the cache, we want to record that these objects are now held in main memory to
prevent them being retrieved from secondary storage again. One approach is to hold a
lookup table that maps OIDs to main memory pointers. We can implement the table
lookup reasonably efficiently using hashing, but this is still slow compared to a pointer
Figure 26.4
Single-level storage
model for OODBMS.
Figure 26.3
Two-level storage
model for
conventional
(relational) DBMS.
26.2.126.2 OODBMS Perspectives |
863
dereference, particularly if the object is already in memory. However, pointer swizzling
attempts to provide a more efficient strategy by storing the main memory pointers in place
of the referenced OIDs and vice versa when the object has to be written back to disk.
In this section we describe some of the issues surrounding pointer swizzling, including
the various techniques that can be employed.
The aim of pointer swizzling is to optimize access to objects. As we have just mentioned,
references between objects are normally represented using OIDs. If we read an object from
secondary storage into the page cache, we should be able to locate any referenced objects
on secondary storage using their OIDs. However, once the referenced objects have been
read into the cache, we want to record that these objects are now held in main memory to
prevent them being retrieved from secondary storage again. One approach is to hold a
lookup table that maps OIDs to main memory pointers. We can implement the table
lookup reasonably efficiently using hashing, but this is still slow compared to a pointer
Figure 26.4
Single-level storage
model for OODBMS.
Figure 26.3
Two-level storage
model for
conventional
(relational) DBMS.
26.2.126.2 OODBMS Perspectives |
863
dereference, particularly if the object is already in memory. However, pointer swizzling
attempts to provide a more efficient strategy by storing the main memory pointers in place
of the referenced OIDs and vice versa when the object has to be written back to disk.
In this section we describe some of the issues surrounding pointer swizzling, including
the various techniques that can be employed.
การแปล กรุณารอสักครู่..