Skip to content

Check table and index size in MariaDB

Query information_schema.TABLES to rank the current database’s base tables by their combined data and index size.

SELECT TABLE_NAME,
TABLE_ROWS AS estimated_rows,
DATA_LENGTH AS data_bytes,
INDEX_LENGTH AS index_bytes,
DATA_LENGTH + INDEX_LENGTH AS total_bytes
FROM information_schema.TABLES
WHERE TABLE_SCHEMA = DATABASE()
AND TABLE_TYPE = 'BASE TABLE'
ORDER BY total_bytes DESC;
  1. Connect to the database you want to inspect.
  2. Click Admin in the toolbar.
  3. Select Storage.
  4. Compare the largest tables’ data and index sizes.

Run the SQL above in the SQL editor when you need the values in bytes.

Column Meaning
estimated_rows The storage engine’s row count; InnoDB reports an estimate
data_bytes The table’s reported data allocation
index_bytes The table’s combined reported index allocation
total_bytes Data allocation plus index allocation

These are storage engine statistics, not a measurement of the server’s entire disk usage.

Your account must be able to read metadata for the tables you want to inspect. The results include tables visible to that account. If expected tables are absent, ask the administrator to check your access or follow admin data unavailable.