Recently I have replicated a MySQL DB from one server to another one. Mean while I have cleared many number of rows from Master DB. So after some time replication is done properly. I verified count of data in both DB, it is same.
After that I just verified DB size in slave using below query.
SELECT table_schema "Schema_Name", Round(Sum(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB" FROM information_schema.tables GROUP BY table_schema;
By this query I got the DB's size. It is 60 GB.
My Problem
I have a file named tableName.ibd inside "ProgramData->Data->DBName" folder. This file occupies 500GB of memory.
So my question is that why this file occupies this much of size, though my DB size itself only 60GB.
Also I verified Ibdata file size inside program data. It is 1GB only.
Please help me on this. How to purge this file. What will be the impact on purging this.