SHOW STATISTICS (Experimental)

On this page Carat arrow pointing down
Warning:
CockroachDB v2.1 is no longer supported. For more details, see the Release Support Policy.

New in v2.1: The SHOW STATISTICS statement lists table statistics used by the cost-based optimizer.

Warning:

This is an experimental feature. The interface and output are subject to change.

Synopsis

SHOW STATISTICS FOR TABLE table_name

Required Privileges

No privileges are required to list table statistics.

Parameters

Parameter Description
table_name The name of the table you want to view statistics for.

Examples

List table statistics

icon/buttons/copy
> CREATE STATISTICS students ON id FROM students_by_list;
CREATE STATISTICS
icon/buttons/copy
> SHOW STATISTICS FOR TABLE students_by_list;
  statistics_name | column_names |             created              | row_count | distinct_count | null_count | histogram_id
+-----------------+--------------+----------------------------------+-----------+----------------+------------+--------------+
  students        | {"id"}       | 2018-10-26 15:06:34.320165+00:00 |         0 |              0 |          0 |         NULL
(1 row)

See Also


Yes No
On this page

Yes No