首页 Tablestore User Guide FAQ Use predefined columns

Use predefined columns

更新时间: 2026-01-14 11:44:14

Predefined columns are non-primary key columns with specified data types that you can use as fields for a secondary index. This topic describes how to use predefined columns.

Notes

Important

When you use a search index, you do not need to add predefined columns to the data table.

  • By default, a single data table supports a maximum of 32 predefined columns. If this limit does not meet your needs, submit a ticket to request an increase.

  • The attribute columns of a secondary index must be one or more of the predefined columns.

Procedure

If you use a secondary index, you can add or delete predefined columns for the data table if none are configured or if the existing columns do not meet your requirements. For more information, see Add predefined columns in the console and Manage predefined columns using an SDK.

Note

You can also add predefined columns when you create a data table. For more information, see Data table operations.

Assume that a data table has three primary key columns (pk1, pk2, and pk3), two predefined columns (col1 and col2), and two attribute columns (col3 and col4). When you create a secondary index, the primary key columns of the table (pk1, pk2, and pk3) can be used only as the primary key columns of the index. The predefined columns (col1 and col2) can be used as either the primary key columns or the attribute columns of the index. The other attribute columns (col3 and col4) cannot be used in the secondary index.

上一篇: ZRS 下一篇: Developer Reference
阿里云首页 表格存储 相关技术圈