SHOW-TABLE-STATS

Name

SHOW TABLE STATS

Description

Use SHOW TABLE STATS to view an overview of statistics collection for a table.

Syntax:

  1. SHOW TABLE STATS table_name;

Where:

  • table_name: The target table name. It can be in the format db_name.table_name.

Output:

Column NameDescription
updated_rowsUpdated rows since the last ANALYZE
query_timesReserved column for recording the number of times the table was queried in future versions
row_countNumber of rows (does not reflect the exact number of rows at the time of command execution)
updated_timeLast update time
columnsColumns for which statistics information has been collected

Here’s an example:

  1. mysql> show table stats lineitem \G;
  2. *************************** 1. row ***************************
  3. updated_rows: 0
  4. query_times: 0
  5. row_count: 6001215
  6. updated_time: 2023-11-07
  7. columns: [l_returnflag, l_receiptdate, l_tax, l_shipmode, l_suppkey, l_shipdate, l_commitdate, l_partkey, l_orderkey, l_quantity, l_linestatus, l_comment, l_extendedprice, l_linenumber, l_discount, l_shipinstruct]
  8. trigger: MANUAL

Keywords

SHOW, TABLE, STATS