Truncated table doesn't make mysql file smaller

I truncated some huge tables, but the mysql file and database remain the same.

Is it worth trimming a table to delete data from mysql?

+4
source share
2 answers

When a large table is deleted or truncated, the InnoDB storage engine for MySQL leaves a blank space and uses it to insert new versions of rows later.

There are ways to shrink the database. Check Re: How to Reduce MySQL Database

+6
source

In version 5.1.55, the size was not reduced after Truncate , even with innodb_file_per_table = 'ON' . Therefore, you need a DROP, and then a CREATE table, and then the size has been reduced .

0
source

Source: https://habr.com/ru/post/1310315/


All Articles