# View Table Statistics 
+ View metadata for a table:
```
mysql> SHOW STATS_META WHERE db_name = 'tpcc' AND table_name = 'orders';
+---------+------------+----------------+---------------------+--------------+-----------+
| Db_name | Table_name | Partition_name | Update_time         | Modify_count | Row_count |
+---------+------------+----------------+---------------------+--------------+-----------+
| tpcc    | orders     |                | 2021-09-13 11:15:41 |       156000 |    312000 |
+---------+------------+----------------+---------------------+--------------+-----------+
1 row in set (0.00 sec)
```
------------------------------------------------------------
View statistics for a table
View various statistics for a table
- View the metadata of the table SHOW STATS_META [showLikeOrWhere];
- Check the health status of the table SHOW STATS_HEALTHY [showLikeOrWhere];
- View the metadata of the column SHOW STATS_HISTORWHERE [showLikeOrWhere];
View the information of the histogram SHOW STATS_BUCKETS [showLikeOrWhere];

```
mysql> SHOW STATS_META WHERE db_name = 'tpcc' AND table_name = 'orders';
+---------+------------+----------------+---------------------+--------------+-----------+
| Db_name | Table_name | Partition_name | Update_time         | Modify_count | Row_count |
+---------+------------+----------------+---------------------+--------------+-----------+
| tpcc    | orders     |                | 2021-09-13 11:15:41 |       156000 |    312000 |
+---------+------------+----------------+---------------------+--------------+-----------+
1 row in set (0.00 sec)
```

- You can view information such as the total number of rows in the table and the number of rows modify by SHOW STATS_META.
- You can check the health of the statistics by SHOW STAT_HEALTHY and coarse filter whether the statistics on the estimate table are accurate. When the health level falls below the automatic update threshold tidb_auto_analyze_ratio mentioned earlier, the optimizer automatically collects statistics within the window period
- You can view information such as the number of different values and the number of nulls in a column by SHOW STATS_HISTORIES. The statement outputs information such as the number of distinct values and the number of nulls for all columns.
- You can view information for each bucket in the histogram via STAT_BUCKETS. From this example, we can see that there is not only the histogram information for the table, but also the histogram information for the index.
