SELECT '=== kms_homol top tables ===' as info;
SELECT TABLE_NAME, TABLE_ROWS,
  ROUND(DATA_LENGTH/1024/1024,1) as data_mb,
  ROUND(INDEX_LENGTH/1024/1024,1) as idx_mb,
  ROUND((DATA_LENGTH+INDEX_LENGTH)/1024/1024,1) as total_mb
FROM information_schema.TABLES
WHERE TABLE_SCHEMA='kms_homol'
ORDER BY DATA_LENGTH DESC LIMIT 25;

SELECT '=== kms_new top tables ===' as info;
SELECT TABLE_NAME, TABLE_ROWS,
  ROUND(DATA_LENGTH/1024/1024,1) as data_mb,
  ROUND(INDEX_LENGTH/1024/1024,1) as idx_mb,
  ROUND((DATA_LENGTH+INDEX_LENGTH)/1024/1024,1) as total_mb
FROM information_schema.TABLES
WHERE TABLE_SCHEMA='kms_new'
ORDER BY DATA_LENGTH DESC LIMIT 25;

SELECT '=== kms_homol tables NOT in kms_new ===' as info;
SELECT TABLE_NAME, TABLE_ROWS,
  ROUND((DATA_LENGTH+INDEX_LENGTH)/1024/1024,1) as total_mb
FROM information_schema.TABLES
WHERE TABLE_SCHEMA='kms_homol'
  AND TABLE_NAME NOT IN (
    SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA='kms_new'
  )
ORDER BY DATA_LENGTH DESC;

SELECT '=== Summary ===' as info;
SELECT TABLE_SCHEMA, COUNT(*) as tables,
  SUM(TABLE_ROWS) as approx_rows,
  ROUND(SUM(DATA_LENGTH)/1024/1024,1) as data_mb,
  ROUND(SUM(INDEX_LENGTH)/1024/1024,1) as idx_mb,
  ROUND(SUM(DATA_LENGTH+INDEX_LENGTH)/1024/1024,1) as total_mb
FROM information_schema.TABLES
WHERE TABLE_SCHEMA IN ('kms_homol','kms_new')
GROUP BY TABLE_SCHEMA;
