Skip to main content

SHOW TABLE STATS

Description​

This statement is used to view the overview statistics of a table.

Syntax​

SHOW TABLE STATS <table_name>;

Required Parameters​

1. <table_name>

Table name

Optional Parameters​

None

Return Value​

ColumnNote
updated_rowstable updated row count
query_timestable query times
row_counttable row count
updated_timetable last modified time
columnsanalyzed column list
triggerlast analyze trigger method
new_partitionflag of new partition first loaded
user_injectflag of user inject statistics
enable_auto_analyzeflag of auto analyzed enabled
last_analyze_timelast analyze time

Access Control Requirements​

The user who executes this SQL must have at least the following permissions:

PrivilegeObjectNotes
SELECT_PRIVTableWhen executing SHOW, the SELECT_PRIV privilege for the queried table is required.

Examples​

  1. Show the overview statistics of table test1.
SHOW TABLE STATS test1;
+--------------+-------------+-----------+---------------------+------------------------+---------+---------------+-------------+---------------------+---------------------+
| updated_rows | query_times | row_count | updated_time | columns | trigger | new_partition | user_inject | enable_auto_analyze | last_analyze_time |
+--------------+-------------+-----------+---------------------+------------------------+---------+---------------+-------------+---------------------+---------------------+
| 0 | 0 | 100000 | 2025-01-17 16:46:31 | [test1:name, test1:id] | MANUAL | false | false | true | 2025-02-05 12:17:41 |
+--------------+-------------+-----------+---------------------+------------------------+---------+---------------+-------------+---------------------+---------------------+