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_bytesFROM information_schema.TABLESWHERE TABLE_SCHEMA = DATABASE() AND TABLE_TYPE = 'BASE TABLE'ORDER BY total_bytes DESC;Check table and index size in MariaDB
Section titled “Check table and index size in MariaDB”- Connect to the database you want to inspect.
- Click Admin in the toolbar.
- Select Storage.
- Compare the largest tables’ data and index sizes.
Run the SQL above in the SQL editor when you need the values in bytes.
Read the size columns
Section titled “Read the size columns”| 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.
Required access
Section titled “Required access”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.
Related
Section titled “Related”- MariaDB overview
- Storage and maintenance for table operations
- Change table structure for column and index changes
- Find slow queries to compare storage with query cost
- MySQL and MariaDB clients for Mac compared