presto-docs/src/main/sphinx/sql/show-stats.rst
.. code-block:: none
SHOW STATS FOR table
SHOW STATS FOR ( SELECT * FROM table [ WHERE condition ] )
SHOW STATS FOR ( SELECT col1, col2,... colN FROM table [ WHERE condition ] )
SHOW STATS FOR table: Show statistics for a specific table.
It provides information about the number of rows, number of nulls, minimum and maximum values,
number of distinct values, and average length for each column in the table.
SHOW STATS FOR ( query ): Show statistics for the result of a specific query.
It provides the same information as SHOW STATS FOR table, but for the result set of the query instead
of a single table.
Any statistics that are not populated or unavailable on the data source are returned as NULL. Any additional
statistics collected on the data source other than those listed below are not included in the output of the
SHOW STATS command.
The summary row does not correspond to any specific column so the column_name value for the summary row is NULL.
The following table lists the returned columns and what statistics they represent.
.. list-table:: Statistics :widths: 20, 40, 40 :header-rows: 1
column_nameNULL in the table summary row.data_sizeNULL in the table summary row. Available for columns of string data types with variable widths.distinct_values_countNULL in the table summary row.nulls_fractionsNULLNULL in the table summary row.row_countNULL in column statistic rows.low_valueNULL in the table summary row. Available for columns of DATE, integer, floating-point, and fixed-precision
data types.high_valueNULL in the table summary row. Available for columns of DATE, integer, floating-point, and fixed-precision
data types.histogramNULL in the table summary row.