Information Technology Reference
In-Depth Information
To reduce the number of messages between processes, in many systems the server
processes lock data items by updating the shared lock table directly instead of
sending requests to a dedicated lock-manager process. In that case the lock table
must be protected by a mutual exclusion mechanism (semaphore) as any other
virtual memory structures shared by many processes.
2.2
Database Pages and Files
The physical database is a collection of pages that contain records. A page is a
fixed-size area on disk (e.g., 4 or 8 or 16 kilobytes), which occupies one disk block
or, if the page is larger than a disk block, several consecutive disk blocks. A disk
block is an area that consists of one or more consecutive sectors on one track of the
surface of the disk. For example, if the size of a block is 8 kilobytes and the size of
a sector is 512 bytes, the block consists of 16 consecutive sectors. A sector is the
smallest addressable unit on the disk.
The operations of a physical database include fetching (reading) a page from disk
to the database buffer in the main memory and flushing (writing) a page from the
buffer to its location on disk. Both operations are performed in a single disk access,
consisting of a seek of the correct track and the read or write of the sequence of
consecutive disk blocks that constitute a page.
The logical database is implemented using the physical database by storing the
tuples of the database in the pages. A page that contains tuples is called a data page .
In addition to data pages, the physical database contains index pages for finding
the data pages efficiently. The structure of the index pages is dependent on how the
tuples are organized in the pages. For the purposes of database management, several
other page types exist.
A tuple is normally stored as one record in a data page. If a tuple is larger than a
page, it needs to be divided into several records which are chained together.
A page contains a header, the record area, and a record index. The page header
contains at least the following information:
1. Page id : the unique identifier of the page.
2. Page type : “relation data page” (tuples from one relation), “cluster data page”
(tuples from multiple relations), “index page” (part of an index to a relation),
“free space” (an unallocated page), “data-dictionary page” (part of the data
dictionary of the database), or “storage-map page” (page that describes the
allocation status of other pages), etc.
3. Internal identifier for the relation, index, or other structure where the page
belongs to.
4. Record count : the number of elements in the record index of this page.
5. Free-space count : information used to maintain areas of free space inside this
page, such as the length of the longest contiguous free area and the total amount
of free space on the page.
Search WWH ::




Custom Search