SnapShooter Backups Server, Database, Application and Laravel Backups - Get fully protected with SnapShooter

MySQL refresh table index after deletion

In MySQL, after deletion of a big chunk of data, the size of the database table might not be updated immediately, in this case, we can run the following two commands to force the engine to catch up with the latest size:

Replace your-table-name with your database table name:

OPTIMIZE TABLE your-table-name;
ANALYZE TABLE your-table-name;