Erase Mysql data

0

I have a table with a large amount of data (380 million). I need to delete the old data that is no longer useful in the system. I'm generating the backup as a precaution.

What is the best way to delete it?

  • Delete with a delete restricting from which date?
  • Delete 50k by 50k?
  • Delete 1k in 1k bit by bit?
  • Or some other way?

I'm doing 50k in 50k but it's quite time consuming. What is the best solution for agility?

    
asked by anonymous 21.08.2018 / 20:50

1 answer

0

Create an index with the date column, after that create a procedure with the command "delete from table where data > '0000-00-00'" and, finally, put an event to call this procedure ( link ). Then wait for the execution.

    
21.08.2018 / 22:40