Predefined columns are specified non-primary key columns with set types for a data table, which can serve as fields in secondary indexes. This topic explains how to utilize predefined columns.
Notes
It is not necessary to add predefined columns to a data table to use a search index created for it.
-
You can define up to 32 predefined columns for a data table. If these are insufficient, or submit a ticket to request an increase.
-
Attribute columns of a secondary index must be chosen from the predefined columns.
Instructions
To use a secondary index, if you have not set predefined columns or the existing ones do not meet your requirements, you will need to add or remove predefined columns for the data table. For detailed instructions, see Add Predefined Columns Through the Console and Manage Predefined Columns Through the SDK.
You can also add predefined columns during the creation of a data table. For detailed instructions, see Data Table Operations.
Assume the primary key of the data table consists of three columns: pk1, pk2, and pk3. The predefined columns include two columns: col1 and col2. The attribute columns include two additional columns: col3 and col4. When creating a secondary index, only pk1, pk2, and pk3 can be used as primary key columns, while col1 and col2 may serve as either primary key columns or attribute columns. Col3 and col4 cannot be used in the secondary index.