Skip to main content
SHOW ALTER TABLE shows the execution of the ongoing ALTER TABLE operations, including:
  • Modify columns.
  • Optimize table schema (from v3.2), including modifying the bucketing method and the number of buckets.
  • Create and delete the rollup index.
  • Modify metadata-only properties of cloud-native (shared-data) tables, such as file_bundling, enable_persistent_index, persistent_index_type, and compaction_strategy. These changes run asynchronously and are shown under COLUMN.

Syntax

  • Show the execution of operations of modifying columns or optimizing table schema.
  • Show the execution of operations of adding or deleting the rollup index.

Parameters

  • {COLUMN | OPTIMIZE | ROLLUP}:
    • If COLUMN is specified, this statement shows operations of modifying columns. For cloud-native (shared-data) tables, it also shows asynchronous metadata-only changes triggered by ALTER TABLE ... SET (...), such as modifying file_bundling, enable_persistent_index, persistent_index_type, or compaction_strategy.
    • If OPTIMIZE is specified, this statement shows operations of optimizing table structure.
    • If ROLLUP is specified, this statement shows operations of adding or deleting the rollup index.
  • db_name: optional. If db_name is not specified, the current database is used by default.
  • WHERE, ORDER BY and LIMIT: optional, and supported for every alter type. The columns they accept are TableName, CreateTime, the finish time, and State. The finish time is returned as FinishTime by COLUMN and OPTIMIZE, and as FinishedTime by ROLLUP; ROLLUP accepts either spelling.

Examples

  1. Show the execution of operations of modifying columns, optimizing table schema, and creating or deleting the rollup index in the current database.
  2. Show the execution of operations related to modifying columns, optimizing table schema, and creating or deleting the rollup index in a specified database.
  3. Show the execution of the most recent operation of modifying columns, optimizing table schema, or adding a rollup index in a specified table.

References