Delete a secondary index

更新时间: 2026-04-30 15:31:54

Call the DeleteIndex operation to delete a secondary index from a data table. Once deleted, the index cannot be restored.

Prerequisites

Usage notes

Deleted secondary indexes cannot be restored. To use the index again, recreate it.

Parameters

Parameter

Description

mainTableName

The name of the data table.

indexName

The name of the index table.

Examples

The following sample code deletes two global secondary indexes from a data table in a single call:

public static void DeleteGlobalIndex()
{
    OTSClient otsClient = Config.GetClient();

    Console.WriteLine("Start delete globalIndex...");

    DeleteGlobalIndexRequest request = new DeleteGlobalIndexRequest(TableName, IndexName);
    otsClient.DeleteGlobalIndex(request);

    DeleteGlobalIndexRequest request2 = new DeleteGlobalIndexRequest(TableName, IndexName2);
    otsClient.DeleteGlobalIndex(request2);

    Console.WriteLine("Global Index is deleted,tableName: " + TableName + ",IndexName:" + IndexName + "," + IndexName2);

}
上一篇: Use a secondary index to read data 下一篇: SQL query
阿里云首页 表格存储 相关技术圈