File 1 – schema

This file contains the schema. It consists of a header, followed by one or more relation pages, attribute pages, and link pages.

The header is shown in table [*].

Table: File 1 header
\begin{table}\begin{record}
1& KDBHDR& Z& a string containing \lq\lq ''RIM DATABASE'...
...cord\char93 }-1}{\hbox{words/row}}+\hbox{row offset}\)}
\end{record}
\end{table}


It contains some identification information and pointers for the other pages. The rest of file 1 pages are relation pages, attribute pages, or link pages.

Relation data always begins on page 2 and continues on other pages via forward pointers. The set of relation pages constitutes the ``Relation table''. The Relation table obviously has `holes'—corresponding to attribute and link pages. The relation table holds dictionary data for all the relations in the database. Each page of the relation table has the following structure:


\begin{List}
% latex2html id marker 83\item[word (1)] pointer to the first row...
... relation.
Relation records are described by table \ref{1-relation}.
\end{List}


Table: File 1 relation record
\begin{table}\begin{record}
1& NEXTROW& 1& pointer$^1$\ to the next row in this...
...\hbox{record\char93 }*\hbox{ZHTOI}+\hbox{row offset}\)}
\end{record}
\end{table}


Attribute data always begins on page 3 and also continues on other pages via forward pointers. The set of attribute pages constitutes the ``Attribute table''. The Attribute table obviously has `holes'—corresponding to relation and link pages. The attribute table holds dictionary data for all the attributes in the database. Each page of the attribute table has the following structure:


\begin{List}
% latex2html id marker 106\item[word (1)] pointer to the first ro...
...on.
The attribute records are described in table
\ref{1-attribute}.
\end{List}


Table: File 1 attribute record
\begin{record}
1& NEXTROW& 1& pointer$^1$\ to the next row in this
table. A ne...
...rac{\hbox{record\char93 }-1}{\hbox{words/row}}+\hbox{row offset}\)}
\end{record}


Link data always begins on page 4 and also continues on other pages via forward pointers. The set of link pages constitutes the ``Link table''. The Link table obviously has `holes'—corresponding to relation and attribute pages.

As an example of a database header, consider the UCS VMS and VM/CMS implementations. We have: ZCW = 4, ZC = 16, and therefore Z = 4. Also, the page length of file 1 is 1024 words (ZF1).

Each row of the relation table occupies 19 (ZRELL = 7+3*Z) words so with 1024 (ZF1) words per page you can fit 53 (ZRELR = (ZF1-1)/ZRELL) rows of relation data on each page. This means that rows 1 through 53 would be on page 1, 54 through 107 on page 2 and so on. To make sure the relation data starts on the second page, rows 1 through 53 are skipped and the first relation row is 54. Therefore the initial value for NRROW is 54.

Each row of the attribute table occupies 14 (ZATTL = 6+2*Z) words so with 1024 words per page we can fit 73 (ZATTR = (ZF1-1)/ZATTL) rows of attribute data on each page. This means that rows 1 through 73 would be on page 1, 74 through 146 on page 2 and so on. To make sure the attribute data starts on the third page, rows 1 through 146 are skipped the first attribute row is 147. Therefore the initial value for NAROW is 147.

Each row of the link table occupies 21 (ZLNKL = 1+5*Z) words so with 1024 words per page we can fit 48 (ZLNKR = (ZF1-1)/ZLNKL) rows of link data on each page. This means that rows 1 through 48 would be on page 1, 49 through 96 on page 2 and so on. To make sure the link data starts on the fourth page, rows 1 through 144 are skipped the first link row is 145. Therefore the initial value for NLROW is 145.