Skip to main content

ANALYZE TABLE

Compute and delete statistics for tables, including estimated number of distinct values, number of rows, and number of null values.

Syntax
ANALYZE TABLE <table_name>
FOR { ALL COLUMNS | COLUMNS ( <column_name1>, <column_name2>, ... ) }
{ COMPUTE | DELETE } STATISTICS

Parameters

{{< sql-section file="data/sql/tables.json" data="analyzingATable" >}}

Examples

Analyze a table
ANALYZE TABLE Samples."samples.dremio.com"."NYC-taxi-trips"
FOR ALL COLUMNS
COMPUTE STATISTICS
Analyze the specified columns for a table
ANALYZE TABLE Samples."samples.dremio.com"."NYC-taxi-trips"
FOR COLUMNS (fare_amount, tip_amount)
COMPUTE STATISTICS