Details
-
Task
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
None
Description
LOAD DATA is the fastest method of loading big data into table.
It would be very useful to add ON DUPLICATE KEY clause to LOAD DATA query.
Example: Load data and get differences
SELECT 30 INTO @version;
LOAD DATA INFILE 'categories.csv' INTO TABLE `raw__categories` (ID_CATEGORY,ID_LANG,NAME) SET
last_seen_version = @version;
ON DUPLICATE KEY UPDATE
`last_edit_version` = IF(VALUES(`NAME`) = `NAME`, `last_edit_version`, @version ),
`last_seen_version` = @version;Primary Key: ID_CATEGORY, ID_LANG
MISSING:
SELECT * from raw__categories WHERE `last_seen_version` < 30;
MODIFIED
SELECT * from raw__categories WHERE `last_edit_version` = 30;