File 2 – data

This file contains the actual data for all relations in the database. The header is shown in table [*].

Table: File 2 header
\begin{table}\begin{record}
1& KDBHDR& Z& a string containing \lq\lq ''RIM DATABASE'...
... & Actual data begins after the header on this page.\\
\end{record}
\end{table}


It contains some identification information and pointers for the other pages. All words after the header record on the first page and all following pages contain actual data. When RIM stores a row of data on file 2 it never breaks a row—each row has all its data values on single pages of file 2. This places a limit on the maximum size of a row. It is two words less than the page size (ZF2).

Each data row has its values plus two additional words which precede the actual data. These words contain the following:


\begin{List}
\item[1] a pointer to the next row in the relation. If no more
ro...
...this pointer is 0.
\item[2] length in words for the actual data row.
\end{List}

The format for each row consists of the actual data values in a one to one correspondence with the attributes as defined for the relation. All numeric values such as INTegers, REALs, and DOUBles are stored in a binary format which is standard for the machine. Text values are stored as ascii-text.

A tuple containing an integer (value <i>), a 10-character text item (value <text>), a double (value <r>), and a date (value <d>) occupies 7 words and looks like this:

2pt
1 2 3 4 5 6 7
att 1 att 2 att 3 att 4
[<i>] [<text>] [<r>] [<d>]
(1 word) (3 words) (2 words) (1 word)


Variable length attributes are the exception to this rule. They have a one-word pointer at their position in the tuple. This pointer contains the offset (from the start of the row) to the actual location of the variable attribute's data. At that offset a two word header contains length information. Following this is the actual value. The same roe, if the character string is variable length, occupies 10 words and looks like this:

2pt
1 2 3 4 5 6 7 8 9 10
att 1 att 2 att 3 att 4 W1 W2 att 3 (value)
[int] [6] [double] [date] [3] [10] [text]
(1 word) (1 word) (2 words) (1 word) (1 word) (1 word) (3 words)


The variable length header (words W1 and W2 in the example) contains


Data type W1 W2


text

# words # chars
scaler 1 0
vector # words # cols
matrix # words #rows

I think