Skip to main content

information_schema.tables

The information_schema.tables system table is a view that provides metadata about all tables across all databases, including their schema, type, engine, and creation details. It also includes storage metrics such as data length, index length, and row count, offering insights into table structure and usage.

DESCRIBE information_schema.tables;

┌────────────────────────────────────────────────────────────────────────────────────┐
│ Field │ TypeNullDefault │ Extra │
├─────────────────┼─────────────────┼────────┼──────────────────────────────┼────────┤
│ table_catalog │ VARCHARNO'' │ │
│ table_schema │ VARCHARNO'' │ │
│ table_name │ VARCHARNO'' │ │
│ table_type │ VARCHARNO'' │ │
engineVARCHARNO'' │ │
│ create_time │ TIMESTAMPNO'1970-01-01 00:00:00.000000' │ │
│ drop_time │ TIMESTAMP │ YES │ NULL │ │
│ data_length │ BIGINT UNSIGNED │ YES │ NULL │ │
│ index_length │ BIGINT UNSIGNED │ YES │ NULL │ │
│ table_rows │ BIGINT UNSIGNED │ YES │ NULL │ │
auto_incrementNULLNONULL │ │
│ table_collation │ NULLNONULL │ │
│ data_free │ NULLNONULL │ │
│ table_comment │ VARCHARNO'' │ │
└────────────────────────────────────────────────────────────────────────────────────┘