Find the 20 largest tables on the server
largest mysql tables | which table is so big | find bloated database table | mysql | mariadb | disk-space | performancemysql -e 'SELECT table_schema, table_name, ROUND((data_length + index_length) / 1024 / 1024, 1) AS mb, table_rows FROM information_schema.tables ORDER BY data_length + index_length DESC LIMIT 20;'Lists the 20 largest tables of all databases with database name, table name, size in MB and estimated row count. Typical candidates are log and statistics tables from plugins, sessions or a bloated wp_options. Add WHERE table_schema = 'wp_example' before ORDER BY to limit the query to one database.
Note: For InnoDB, table_rows is only an approximation.
Also searched as
- largest mysql tables
- which table is so big
- find bloated database table