Storage Requirements

Variable-length columns whose declared column length is greater than 128 bytes are stored out of line. Variable-length columns whose declared column length is less than or equal to 128 bytes are stored inline. All LOB data types are stored out of line.

For character semantics, the number of bytes stored out of line depends on the character set. For example, for a character set with four bytes per character, variable-length columns whose declared column length is greater than 32 (128/4) are stored out of line.

Table 1-5 shows the storage requirements of the various data types.

Table 1-5 Data type storage requirements

Type Storage required

BINARY(n)

n bytes

BINARY_DOUBLE

Eight bytes

BINARY_FLOAT

Four bytes

CHAR(n[BYTE|CHAR])

n bytes or, if character semantics, n characters

If character semantics, the length of the column (n) is based on length semantics and character set.

DATE

Seven bytes

Interval

An interval type cannot be stored in TimesTen

NCHAR(n)

Bytes required is 2*n where n is the number of characters

NUMBER

Five to 22 bytes

NVARCHAR2(n)

For NOT INLINE columns:

2*(length of value) + 24 bytes (minimum of 40 bytes).

For INLINE columns:

2*(length of column) + 8 bytes.

ROWID

Twelve bytes

TIMESTAMP

Twelve bytes

TT_BIGINT

Eight bytes

TT_DATE

Four bytes

TT_INT[EGER]

Four bytes

TT_SMALLINT

Two bytes

TT_TIME

Eight bytes

TT_TIMESTAMP

Eight bytes

TT_TINYINT

One byte

VARBINARY(n)

For NOT INLINE columns:

Length of value + 24 bytes (minimum of 40 bytes).

For INLINE columns:

Length of column + 8 bytes.

VARCHAR2(n[BYTE|CHAR])

For NOT INLINE columns:

Length of value + 24 bytes (minimum of 40 bytes). NULL value is stored as (null bit) + 8 bytes, or 8.125 bytes.

This storage principal holds for all variable length NOT INLINE data types: TT_VARCHAR, TT_NVARCHAR, VARCHAR2, NVARCHAR2, and VARBINARY.

For INLINE columns:

n + 8 bytes. NULL value is stored as (null bit) + n + 8 bytes.

If character semantics, the length of the column (n) is based on length semantics and character set.

BLOB and CLOB

Length of value + 48 bytes (minimum of 56 bytes)

NCLOB

2 * (length of value) + 48 bytes (minimum of 56 bytes)