Contact us

Textual Strings


STRING | STR

A textual type for storing arbitrary-length UTF8-encoded strings.

Other, standard SQL names for this type are char, varchar and text.

Even though MSQL's syntax is case-insensitive, string values are case-sensitive. Therefore, 'banana' < 'ZEBRA' would return false as Z is before b in the ASCII/UTF-8 ordering. If a case-insensitive comparison is desired, the strings should first be transformed into the same case, e.g. using LOWER or UPPER functions.

For more details about using text string literals in MSQL, see the String literals section.

Internally, it takes sizeof(str) + 8 bytes to store a string value, where sizeof(str) is the number of bytes required to store the value itself. This is often not the same as the number of characters in a string, as non-ASCII characters are encoded using more than 1B per character.

string values cannot be stored into SpaceTime tables. If you need to store small, often-repeating string values (such as tags or enum values), try symbol | sym type.


SYMBOL | SYM

A textual type for representing short, often-repeated UTF8-encoded strings in a symbol table.

Internally, symbol values are stored in a symbol table separate from the actual record, and the symbol column in the original record is replaced with the u32 index in the symbol table. symbol values actually exist only on disk, and are automatically converted to string values when they are accessed from a query.

This is a SpaceTime-only type, designed for efficiently storing short, often repeated string values such as unique identifiers, tags or enum values.


Binary Strings


BSTRING | BSTR

A binary type for storing arbitrary-length byte sequences.

Other names for this type are binary, varbinary, blob and bytea.

For more details about using byte-string literals in MSQL, see the Byte-string literals section.

Internally, it takes length(sequence) + 8 bytes to store a varbinary value, where length(sequence) is the number of bytes in the byte sequence.

bstring values cannot be stored into SpaceTime tables. If you need to store small, often-repeating binary values (such as UUIDs), try bsymbol | bsym type.


BSYMBOL | BSYM

A binary type for representing short, often-repeated byte strings in a symbol table.

Internally, bsymbol values are stored in a symbol table separate from the actual record, and the bsymbol column in the original record is replaced with the u32 index in the symbol table. bsymbol values actually exist only on disk, and are automatically converted to bstring values when they are accessed from a query.

This is a SpaceTime-only type, designed for efficiently storing short, often repeated byte string values such as binary UUIDs.