- Only characters from the English alphabet, digits and underscore are allowed
- Names cannot start with a digit
- Case insensitive without escape character "`"
- Identifier with escape character "`" To support more flexible table or column names, a new escape character "`" is introduced. For more details please refer to escape.
The legal character set is
- Maximum length of database name is 32 bytes.
- Maximum length of table name is 192 bytes, excluding the database name prefix and the separator.
- Maximum length of each data row is 48K bytes since version 188.8.131.52 , before which the limit was 16K bytes. Please note that the upper limit includes the extra 2 bytes consumed by each column of BINARY/NCHAR type.
- Maximum length of column name is 64.
- Maximum number of columns is 4096. There must be at least 2 columns, and the first column must be timestamp.
- Maximum length of tag name is 64.
- Maximum number of tags is 128. There must be at least 1 tag. The total length of tag values should not exceed 16K bytes.
- Maximum length of singe SQL statement is 1048576, i.e. 1 MB. It can be configured in the parameter
maxSQLLengthin the client side, the applicable range is [65480, 1048576].
- At most 4096 columns (or 1024 prior to 184.108.40.206) can be returned by
SELECT. Functions in the query statement constitute columns. An error is returned if the limit is exceeded.
- Maximum numbers of databases, STables, tables are dependent only on the system resources.
- Maximum of database name is 32 bytes, and it can't include "." or special characters.
- Maximum number of replicas for a database is 3.
- Maximum length of user name is 23 bytes.
- Maximum length of password is 15 bytes.
- Maximum number of rows depends only on the storage space.
- Maximum number of tables depends only on the number of nodes.
- Maximum number of databases depends only on the number of nodes.
- Maximum number of vnodes for a single database is 64.
GROUP BY can be performed on tags and
TBNAME. It can be performed on data columns too, with the only restriction being it can only be performed on one data column and the number of unique values in that column is lower than 100,000. Please note that
GROUP BY cannot be performed on float or double types.
IS NOT NULL
IS NOT NULL can be used on any data type of columns. The non-empty string evaluation expression, i.e.
< > "" can only be used on non-numeric data types.
- Only one
order byis allowed for normal table and subtable.
- At most two
order byare allowed for STable, and the second one must be
order by tagmust be used with
group by tagon same tag. This rule is also applicable to
order by columnmust be used with
group by columnor
top/bottomon same column. This rule is applicable to table and STable.
order by tsis applicable to table and STable.
order by tsis used with
group by, the result set is sorted using
tsin each group.
Restrictions of Table/Column Names
Name Restrictions of Table/Column
The name of a table or column can only be composed of ASCII characters, digits and underscore and it cannot start with a digit. The maximum length is 192 bytes. Names are case insensitive. The name mentioned in this rule doesn't include the database name prefix and the separator.
Name Restrictions After Escaping
To support more flexible table or column names, new escape character "`" is introduced in TDengine to avoid the conflict between table name and keywords and break the above restrictions for table names. The escape character is not counted in the length of table name.
With escaping, the string inside escape characters are case sensitive, i.e. will not be converted to lower case internally.
For example: `aBc` and `abc` are different table or column names, but "abc" and "aBc" are same names because internally they are all "abc".
The characters inside escape characters must be printable characters.
Escape character "`" is available from version 220.127.116.11.