This topic describes the limits on secondary indexes.

Limits on index tables

ItemLimitDescription
Length of a table name1~255 BytesThe name of a table can contain letters, digits, and underscores (_). The name must start with a letter or an underscore (_).
Number of secondary indexes that are created for a table5A maximum of five index tables can be created for each data table.
Number of index columns1 to 4You can add up to four index columns to an index table. Index columns in an index table are a combination of primary key columns and predefined columns of the data table for which the index table is created.
Number of primary key columns8The primary key of an index table consists of index columns and all primary key columns of the data table for which the index table is created.
Data types supported by index columnsSTRING, INTEGER, and BINARYThe data types supported by index columns are STRING, INTEGER, and BINARY.
Number of attribute columns32You can add up to 32 attribute columns to an index table. Attribute columns in an index table are a combination of predefined columns of the data table for which the index table is created.
Data types supported by attribute columnsSTRING, INTEGER, DOUBLE, BOOLEAN, and BINARYThe data types supported by attribute columns are STRING, INTEGER, DOUBLE, BOOLEAN, and BINARY.

Other limits

ItemLimitDescription
Index columnColumns except auto-increment primary key columnsThe first primary key column of an index table cannot be an auto-increment primary key column.
Operation on data in index tablesRead-onlyYou can only read data from index tables. You cannot write data to index tables.
Max versionsNot supportedYou cannot create secondary indexes for data tables for which max versions is enabled.
Time to live (TTL)SupportedYou must prohibit updates to a data table to ensure that the TTL of the data table is the same as the TTL of the index table that is created for the data table.
StreamNot supportedNone.
Query from data tablesNot supportedQueries from data tables are required.