I have a 50 GB mysql database (80 tables) that I need to remove from it. I have a lookup table containing a list if product identifiers that need to be removed from other tables.
Now the rest of the tables can be 2 GB each, contain items that need to be deleted.
My question is: since this is not a small database, what is the safest way to delete data in one frame in order to avoid problems?
What is the best method to verify that all data has been deleted?
Thirler , . ., . ,
delete from a where id in (select id from keys)
LIMIT DELETE. . , . :
create function check_consistency() returns boolean begin return not exists(select * from child where id not in (select id from parent) ) and not exists(select * from child2 where id not in (select id from parent) ); -- and so on end
, . . mysql ( , , InnoDB) ( ). , (, ), , (, product_storage). , 100% - . . , , , , ( )
100% . , , , , sql-, , .
, , . burnall , , .
, , , , , , .
, . 1 MySQL. , , InnoDB. myisam InnoDB, . - :
START TRANSACTION; ...Perform changes... ...Control changes... COMMIT; ...or... ROLLBACK;
?
PostgreSQL > 250 . , . , , / .
//
, , -, , - MySQL. :
http://dev.mysql.com/doc/refman/5.1/en/partitioning.html
, () datetime .