I'm using MySQL 5.5 with a table in InnoDB running:
deletemetinyint NOT NULL DEFAULT 0;`
UPDATE `import` SET `deleteme` = 1; -- Set the delete field LOAD DATA LOW_PRIORITY LOCAL INFILE "import.csv" REPLACE INTO TABLE `import` FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY """" LINES TERMINATED BY "\n" IGNORE 1 LINES (`id`, `name`, `m_id`, `sku`) SET `deleteme` = 0; DELETE FROM `import` WHERE `deleteme` = 1;
Almost all of the tables have over 200,000 rows in them, and it's taking to long to update the tables. Is there a better, faster way to do this?
This is on a VPS with 2gb ram w/ 4 Cores and it's not taxing anything doing these updates, it's just SLOW.
Demo of working code.