<@U0A71G31CDV> is there a STRING datatype in Starr...
# questions-and-troubleshooting
и
@Rocky is there a STRING datatype in Starrocks?
r
Yes, StarRocks has a STRING data type. Key Characteristics: * Variable Length: It is used to store variable-length character strings. * Maximum Length: The maximum length is 65,533 bytes. * Relation to VARCHAR: In StarRocks,
STRING
is essentially an alias for
VARCHAR(65533)
. Usage Notes: * Memory Efficiency: Even though
STRING
is variable-length, StarRocks may use the maximum defined length for memory pre-allocation in certain query execution stages. Therefore, it is generally recommended to use
VARCHAR(n)
with a specific length if you know the data will not exceed that size (e.g.,
VARCHAR(100)
for an address), as this can be more memory-efficient than using
STRING
. * Versioning: While the standard
STRING
limit is 65,533 bytes, starting from version 2.1, StarRocks increased the maximum possible length for the
VARCHAR
type to 1,048,576 bytes (1 MB). If you need strings longer than 65,533 bytes, you should explicitly use
VARCHAR(1048576)
. * Encoding: StarRocks supports UTF-8 encoding. Note that the length is defined in bytes, not characters (e.g., one Chinese character typically occupies 3 bytes). Referencesfaq/table_design_faq.mdsql-reference/System_limit.mdknowledge/usage/best-practice.mdsql-reference/data-types/string-type/STRING.mdfaq/Others.mdsql-reference/data-types/string-type/BINARY.md