Variable-length encoding is automatically applied when tables
are loaded into MySQL HeatWave with the exception of string columns
defined explicitly as dictionary-encoded columns. . You can
define
the encoding type while creating the table or later
modify it using ALTER
TABLE
statement.
VARLEN
columns can be declared as NULL.
Variable-length (VARLEN
) encoding has the
following characteristics:
Supports all character sets and collation types supported by the DB System, and expressions with non-boolean types. User defined character sets are not supported.
Minimizes the amount of data stored for string columns by efficiently storing variable length column values.
Permits more operations involving string columns to be offloaded than dictionary encoding.
Is more efficient than dictionary encoding with respect to storage and processing of string columns with a high number of distinct values relative to the cardinality of the table.
For information about MySQL HeatWave column limits and how they relate to VARLEN encoded columns, see Column Limits.
For MySQL HeatWave nodes, a
VARLEN
encoded column value requires enough memory for the data plus two bytes for length information. Internal fragmentation or headers can affect the actual amount of memory required.For DB System node, there is no memory requirement, apart from a small memory footprint for metadata.
For supported functions and operators, refer to Section 5.3, “Supported Functions and Operators”.
VARLEN supports the following filters:
Column-to-column filters, excluding the
<=>
filter.Column-to-constant filters, excluding the
<=>
filter.
The presence of
VARLEN
encodedVARCHAR
orCHAR
columns does not affect table load performance.Table load and change propagation operations perform more slowly on
VARLEN
encodedTEXT
type columns than onVARLEN
encodedVARCHAR
columns.-
There are two main differences with respect to MySQL HeatWave result processing for variable-length encoding compared to dictionary encoding:
A dictionary decode operation is not required, which means that fewer CPU cycles are required.
Because
VARLEN
encoded columns use a larger number of bytes than dictionary-encoded columns, the network cost for sending results from MySQL HeatWave to the DB System is greater.
Learn more about Dictionary Encoding.