- VARBYTE
- VARCHAR
- VARCHAR(n) CHARACTER SET GRAPHIC
- CLOB/BLOB
The description assumes that all variable length compressible columns are treated as an extension of fixed length compressible columns except that decompressed variable length columns store both a length and the actual column data. There is an additional presence bit for an algorithmically compressed column to indicate whether the column data is compressed. Vantage sets this bit only when data in a column is compressed using algorithmic compression.
The database stores column data that is compressed algorithmically as length: data pairs interleaved with the other compressible columns in the table. When column data is null, the database does not store a length, so there is no overhead in that case.
- When compression does not apply to a value in a column that specifies multivalue compression, the database stores the column data in the row as a length and data value pair.
If the length of the column data is ≤ 255 bytes, the database stores the length in 1 byte, otherwise in 2 bytes.
A variable length column (without compression) has a 2-byte offset associated with it, whereas a compressed variable length column can have its length stored in one or two bytes, depending on whether the column length is ≤ 255, respectively.
- The database stores uncompressed variable length data in the row as a length and data value pair.
The stored length for multivalue compressed data is the length of the uncompressed column value.
- If a variable or fixed length multivalue compressed column is compressed or is null, then its values are not stored in the row.
Instead, the database stores one instance of each compressed value within a column in the table header and references that value using the presence bits array for the row.
- If a fixed length multivalue compressed column is not compressed, then the database stores its values in the row as data, but without an accompanying length. No length is needed because the database pads fixed length data values to the maximum length defined for their containing column.
- If a variable length column is not compressed, then the database stores its values in the row as a length and data value pair.
- If a fixed length column is not compressed, then the database stores its values in the row as data, but without an accompanying length.
The database pads fixed length data values to the maximum length defined for their containing column.
- For an algorithmically-compressed column with a variable length, the database stores its values in the row as a length and data value pair.
The stored length for algorithmically-compressed data is the length of the compressed column value, not its original, uncompressed length.
If the length of the column data is ≤ 255 bytes, the database stores the length in 1 byte, otherwise in 2 bytes.
- For an algorithmically-compressed column with either a variable length or a fixed length, the database does not store a representation of its data in the row if the column is null, but does indicate its existence in the data using the presence bit array for the row.
The following sets of examples demonstrate the specific effects on row structure for multivalue compression alone (cases 1, 2, and 3 of example 1), algorithmic compression alone (cases 1, 2, and 3 of example 2), and combined multivalue and algorithmic compression (cases 1, 2, and 3 of example 3). In each case, the row structure diagram is based on the structure for a partitioned table even though the examples are all for nonpartitioned primary index tables.