Partitioning and freeing disk space
-
31-10-2019 - |
Question
I am running MySql innodb with innodb_file_per_table.
As a daily script, I would like to create a new partition for a set of tables, as well as delete yesterday's partitions. What command would need to be run to delete the old partitions to free up the disk space? I would like to avoid having a system that runs out of disk space because of the database disk usage. I would also like to avoid having to shut down Mysql.
Edit: I have read that discarding the tablespace should delete the .ibd files that take up most of the space.
ALTER TABLE tbl_name DISCARD TABLESPACE;
However there is a known bug using this command on partitioned tables.
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange