- Plesk Onyx for Linux
- Why the size of database shown in Home > Domains > example.com > View More Statistics does not match with the size of the database itself, shown in Home > Domains > example. com > Databases tab > database1?
- The database uses InnoDB engine.
Such a difference is expected for InnoDB databases.
Size in the Databases tab is taken from the
information_schema table, which is the real size of the database itself.
Statistics is sowing the actual size of the
It is possible to use the OPTIMIZE TABLE maintenance feature from MySQL, as it reorganizes the physical storage of table data and associated index data, to reduce storage space and improve I/O efficiency when accessing the table.
Refer to the official MySQL documentation for more details.
The following query checks single database size in MySQL:
# mysql> SELECT table_schema "Database Name", SUM( data_length + index_length)/1024/1024"Database Size (MB)" FROM information_schema.TABLES where table_schema = 'database1';