MemCom Reference Manual > The MemCom Database Structure > The Relational Table Structure

2. The Relational Table Structure

Entries in relational tables are stored in a contiguous way in the table buffer. An entry in a relational table has the following structure:

+------+------+------+------+------+------+
| next | lkey | key  | type | nel  | data |
+------+------+------+------+------+------+

The elements of an entry are described in the table below:

nextPointer to next entry in table (4 bytes).
lkeyLength of key (4 bytes).
keyKeyword (lkey + 1 bytes).
typeData type (2 bytes).
nelNumber of data elements (4 bytes).
dataData (nb*nel bytes), where nb is the number of bytes required for representing a data element.

Thus, the required number of bytes for an entry in a relational table is

15 + lkey + size_of(type)*nel

bytes, where lkey is the number of bytes of the string key, size_of(type) the number of bytes required to store one data element, and nel the number of data elements.