Quantcast
Channel: "INSERT IGNORE" vs "INSERT ... ON DUPLICATE KEY UPDATE" - Stack Overflow
Viewing all articles
Browse latest Browse all 13

"INSERT IGNORE" vs "INSERT ... ON DUPLICATE KEY UPDATE"

$
0
0

While executing an INSERT statement with many rows, I want to skip duplicate entries that would otherwise cause failure. After some research, my options appear to be the use of either:

  • ON DUPLICATE KEY UPDATE which implies an unnecessary update at some cost, or
  • INSERT IGNORE implies an invitation for other kinds of failure to slip in unannounced.

Am I right in these assumptions? What's the best way to simply skip the rows that might cause duplicates and just continue on to the other rows?


Viewing all articles
Browse latest Browse all 13

Latest Images

Trending Articles





Latest Images