Question

I truncated several huge tables, but the mysql file and database appears to remain at the same size.

Does truncate table delete the data from mysql as well?

Was it helpful?

Solution

When a large table is deleted or truncated InnoDB storage engine for MySQL will leave the empty space, and use it for subsequent insertion of new row versions.

There are ways to shrink database. Check Re: how to shrink a MySQL database

OTHER TIPS

In Version 5.1.55 size was not reduced after Truncate , even with innodb_file_per_table='ON'. So need to DROP and then CREATE the table and then Size was reduced.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top