All Products
Search
Document Center

PolarDB:CHECK PARTITION

Last Updated:Jan 11, 2024

This topic describes how to check a partition or subpartition and display whether the data or indexes are corrupted in the partition or subpartition.

Syntax

The ALTER TABLE ... CHECK PARTITION statement is used to check a partition or subpartition and display whether the data or indexes are corrupted in the partition or subpartition.
ALTER TABLE table_name
    CHECK PARTITION {partition_names | ALL}
partition_names is:
{partition_name | subpartition_name}

Parameters

ParameterDescription
table_nameThe name (optionally schema-qualified) of the partitioned table.
partition_nameThe name of the partition.
subpartition_nameThe name of the subpartition.

Examples

Check the q1_2021 partition and the p5 subpartition of the sales_range_list table:
ALTER TABLE sales_range_list CHECK PARTITION q1_2021,q5;
Check the p5 subpartition of the sales_range_list table:
ALTER TABLE sales_range_list CHECK PARTITION q5;