AnalyticDB PostgreSQL版7.0版支持了列組(Column Group)統計信息功能,您可以指定收集多個目標列的聯合統計信息,在代價估算時打破獨立分布的假設,提高代價估算的準確性,進而提升查詢性能。
注意事項
列組統計信息功能目前僅支持Planner優化器(原Legacy優化器),如何設置優化器,請參見參數配置。
語法
CREATE STATISTICS [ IF NOT EXISTS ] statistics_name
[ ( statistics_kind [, ... ] ) ]
ON column_name, column_name [, ...]
FROM table_name
參數介紹
參數 | 說明 |
---|---|
statistics_name | 列組統計信息的名稱。 |
statistics_kind | 需要收集的統計信息種類,目前支持以下三種:
|
column_name | 列組統計信息包含的列的名稱,至少需要指定兩個列。 |
table_name | 上述列所屬的表名。 |