I started this as a response to Keith Murphy’s post at http://www.paragon-cs.com/wordpress/?p=54, but it
got long, so it deserves its own post. The basic context is
figuring out how not to cause duplicate information if a large
INSERT statement fails before finishing.
Firstly, the surefire way to make sure there are no duplicates if you have a unique (or primary) key is to use INSERT IGNORE INTO.
Secondly, I just experimented with adding an index to an InnoDB table that had 1 million rows, and here’s what I got (please note, this is one experience only, the plural …