I have an InnoDB table with an index on it. I have a few million rows to insert, so I thought I might take advantage of the row-level locking and do it in parallel. I'm inserting in batches of 10000, each in a transaction.
Because there may be clashes, I need to make a decision for each row:
INSERT INTO my_table (a, b, c) values ('a', 'b', 3) ON DUPLICATE KEY UPDATE a = IF(c<VALUES(c), a, VALUES(a)), b = IF(c<VALUES(c), b, VALUES(b)), c = IF(c<VALUES(c), c, VALUES(c));
If I run a few (e.g. 10) parallel insertion threads, is this a good idea? Will it cause me deadlocks due to contention on the index?