MySQL Forums
Forum List  »  MyISAM

Re: Dumping enormous MYISAM table with BLOB based on WHERE clause
Posted by: Jonathan Stephens
Date: January 29, 2015 06:27AM

Why is it necessary to drop/re-create/reload the table? You're not interested in saving any of the old data, right? So why not just run something like this in the mysql client?

DELETE FROM upload_table WHERE serve_date < "2015-01-01";

OPTIMIZE TABLE upload_table;

OPTIMIZE TABLE should recover the space from the deleted rows and rebuild any indexes that need it.

Jon Stephens
MySQL Documentation Team @ Oracle

MySQL Dev Zone
MySQL Server Documentation

Options: ReplyQuote

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.