All Products
Search
Document Center

PolarDB:ANALYZE PARTITION

Last Updated:Jan 11, 2024

This topic describes how to update statistics of partitions or subpartitions.

Syntax

The ALTER TABLE ... ANALYZE PARTITION statement is used to update statistics of partitions or subpartitions.
ALTER TABLE table_name
 ANALYZE 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

Update statistics of the q1_2021 partition and the p5 subpartition of the sales_range_list table:
ALTER TABLE sales_range_list ANALYZE PARTITION q1_2021,p5;
Update statistics of the p5 subpartition of the sales_range_list table:
ALTER TABLE sales_range_list ANALYZE PARTITION p5;