A fixed-length string ofDocumentation Index
Fetch the complete documentation index at: https://private-7c7dfe99-page-updates.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
N bytes (neither characters nor code points).
To declare a column of FixedString type, use the following syntax:
N is a natural number.
The FixedString type is efficient when data has the length of precisely N bytes. In all other cases, it is likely to reduce efficiency.
Examples of the values that can be efficiently stored in FixedString-typed columns:
- The binary representation of IP addresses (
FixedString(16)for IPv6). - Language codes (ru_RU, en_US … ).
- Currency codes (USD, RUB … ).
- Binary representation of hashes (
FixedString(16)for MD5,FixedString(32)for SHA256).
- Complements a string with null bytes if the string contains fewer than
Nbytes. - Throws the
Too large value for FixedString(N)exception if the string contains more thanNbytes.
FixedString(2) column:
FixedString(N) value is constant. The length function returns N even if the FixedString(N) value is filled only with null bytes, but the empty function returns 1 in this case.
Selecting data with WHERE clause return various result depending on how the condition is specified:
- If equality operator
=or==orequalsfunction used, ClickHouse doesn’t take\0char into consideration, i.e. queriesSELECT * FROM FixedStringTable WHERE name = 'a';andSELECT * FROM FixedStringTable WHERE name = 'a\0';return the same result. - If
LIKEclause is used, ClickHouse does take\0char into consideration, so one may need to explicitly specify\0char in the filter condition.