SELECT table_name AS `table`, round(((data_length + index_length) / 1024 / 1024), 2) `size in MB`
FROM information_schema.TABLES
WHERE table_schema = "DATABASE_NAME"
ORDER BY `size in MB` DESC
LIMIT 10;
<?php
$error_message = t('There is an error with this.');
\Drupal::messenger()->addError($error_message));
\Drupal::logger('my_module')->log('error', $error_message);