Each data row has its values plus two additional words which precede the actual data. These words contain the following:
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:
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:
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 |
|
# words | # chars |
scaler | 1 | 0 |
vector | # words | # cols |
matrix | # words | #rows |