Deleting huge chunks of data from mysql innodb

Posted by ming yeow on Stack Overflow See other posts from Stack Overflow or by ming yeow
Published on 2010-05-12T04:28:31Z Indexed on 2010/05/12 4:34 UTC
Read the original article Hit count: 456

Filed under:
|
|

I need to delete a huge chunk of my data in my production database, which runs about 100GB in size. If possible, i would like to minimize my downtime.

My selection criteria for deleting is likely to be

DELETE * FROM POSTING WHERE USER.ID=5 AND UPDATED_AT<100

What is the best way to delete it?

  • Build an index?
  • Write a sequential script that deletes via paginating through the rows 1000 at a time?

© Stack Overflow or respective owner

Deleting huge chunks of data from mysql innodb

Posted by mingyeow on Server Fault See other posts from Server Fault or by mingyeow
Published on 2010-05-12T04:15:48Z Indexed on 2010/05/12 4:25 UTC
Read the original article Hit count: 456

I need to delete a huge chunk of my data in my production database, which runs about 100GB in size. If possible, i would like to minimize my downtime.

My selection criteria for deleting is likely to be

DELETE * FROM POSTING WHERE USER.ID=5 AND UPDATED_AT<100

What is the best way to delete it?

  • Build an index?
  • Write a sequential script that deletes via paginating through the rows 1000 at a time?

© Server Fault or respective owner

Related posts about innodb

Related posts about mysql