14.3. ANALYZE

Synopsis

ANALYZE table_name [ WITH ( property_name = expression [, ...] ) ]

Description

Collects table and column statistics for a given table. Connector might provide additional ANALYZE properties which can be passed via optional WITH clause.

Currently the only connector that supports ANALYZE command is the Hive Connector.

Examples

Analyze table web to collect table and column statistics:

ANALYZE web;

Analyze table stores in catalog hive and schema default:

ANALYZE hive.default.stores;

Analyze partitions '1992-01-01', '1992-01-02' from a Hive partitioned table sales:

ANALYZE hive.default.sales WITH (partitions = ARRAY[ARRAY['1992-01-01'], ARRAY['1992-01-02']]);

Analyze partitions with complex partition key (state, city columns) from a Hive partitioned table customers:

ANALYZE hive.default.customers WITH (partitions = ARRAY[ARRAY['CA', 'San Francisco'], ARRAY['NY', 'NY']]);