数据仓库服务 GaussDB(DWS)-ANALYZE | ANALYSE:语法格式

时间:2025-02-12 15:05:10

语法格式

  • 收集表的统计信息。
    12
    { ANALYZE | ANALYSE } [ VERBOSE ]    [ table_name [ ( column_name [, ...] ) ] ];
  • 收集分区表的统计信息。
    123
    { ANALYZE | ANALYSE } [ VERBOSE ]    [ table_name [ ( column_name [, ...] ) ] ]    PARTITION ( partition_name ) ;

    普通分区表目前支持针对某个分区的统计信息的语法,但功能上不支持针对某个分区的统计信息收集。对指定分区执行ANALYZE,会有相应的WARNING提示。

  • 收集外表的统计信息。
    12
    { ANALYZE | ANALYSE } [ VERBOSE ]    { foreign_table_name | FOREIGN TABLES };
support.huaweicloud.com/sqlreference-dws/dws_06_0245.html