TiDBTiDB Docs Dash 2024

Jan 9 - Jan 12 (UTC)
Join us to improve docs and win a prize!
Sign InTry Free

SHOW STATS_HISTOGRAMS

This statement shows the histogram information collected by the ANALYZE statement.

Synopsis

ShowStmt

ShowStmt

ShowTargetFiltertable

ShowTargetFilterable

ShowLikeOrWhereOpt

ShowLikeOrWhereOpt

Examples

show stats_histograms;
+---------+------------+----------------+-------------+----------+---------------------+----------------+------------+--------------+-------------+ | Db_name | Table_name | Partition_name | Column_name | Is_index | Update_time | Distinct_count | Null_count | Avg_col_size | Correlation | +---------+------------+----------------+-------------+----------+---------------------+----------------+------------+--------------+-------------+ | test | t | | a | 0 | 2020-05-25 19:20:00 | 7 | 0 | 1 | 1 | | test | t2 | | a | 0 | 2020-05-25 19:20:01 | 6 | 0 | 8 | 0 | | test | t2 | | b | 0 | 2020-05-25 19:20:01 | 6 | 0 | 1.67 | 1 | +---------+------------+----------------+-------------+----------+---------------------+----------------+------------+--------------+-------------+ 3 rows in set (0.00 sec)
show stats_histograms where table_name = 't2';
+---------+------------+----------------+-------------+----------+---------------------+----------------+------------+--------------+-------------+ | Db_name | Table_name | Partition_name | Column_name | Is_index | Update_time | Distinct_count | Null_count | Avg_col_size | Correlation | +---------+------------+----------------+-------------+----------+---------------------+----------------+------------+--------------+-------------+ | test | t2 | | b | 0 | 2020-05-25 19:20:01 | 6 | 0 | 1.67 | 1 | | test | t2 | | a | 0 | 2020-05-25 19:20:01 | 6 | 0 | 8 | 0 | +---------+------------+----------------+-------------+----------+---------------------+----------------+------------+--------------+-------------+ 2 rows in set (0.00 sec)

MySQL compatibility

This statement is a TiDB extension to MySQL syntax.

See also

Was this page helpful?

Download PDFRequest docs changesAsk questions on Discord
Playground
New
One-stop & interactive experience of TiDB's capabilities WITHOUT registration.
Products
TiDB
TiDB Dedicated
TiDB Serverless
Pricing
Get Demo
Get Started
© 2024 PingCAP. All Rights Reserved.
Privacy Policy.