Comments on: 3 ways to write UPSERT and MERGE queries in MySQL http://www.xaprb.com/blog/2006/06/17/3-ways-to-write-upsert-and-merge-queries-in-mysql/ Stay curious! Fri, 10 May 2013 18:25:19 +0000 hourly 1 http://wordpress.org/?v=3.5.1 By: J Jorgenson http://www.xaprb.com/blog/2006/06/17/3-ways-to-write-upsert-and-merge-queries-in-mysql/#comment-5681 J Jorgenson Thu, 12 Apr 2007 18:23:53 +0000 http://www.xaprb.com/blog/?p=180#comment-5681 The “INSERT .. SELECT .. ON DUPLICATE KEY” can work *MUCH* faster than a similar “INSERT … SELECT .. GROUP BY” when there is not much duplication against the Primary/Unique key on the Inserted table.

The disk I/O is greatly increased but there are *NO* temporary tables involved greatly reducing RAM/Temp space requirements of the MySQL Server.

In a data warehousing world, the ON DUPLICATE KEY (UPSERT) is crutial !!

]]>
By: Xaprb http://www.xaprb.com/blog/2006/06/17/3-ways-to-write-upsert-and-merge-queries-in-mysql/#comment-1059 Xaprb Mon, 10 Jul 2006 00:42:15 +0000 http://www.xaprb.com/blog/?p=180#comment-1059 After deleting them, though. So it’s actually a DELETE/INSERT construct. I didn’t mean to imply it was an UPDATE. I just wanted to list out ways to get similar functionality.

This is great that you’re commenting, by the way. One of my goals with this blog is to learn as much as possible. Hopefully it’s also useful to others, but it’s a great chance for me to get corrections where I need them.

]]>
By: Arjen Lentz http://www.xaprb.com/blog/2006/06/17/3-ways-to-write-upsert-and-merge-queries-in-mysql/#comment-1058 Arjen Lentz Sun, 09 Jul 2006 23:12:39 +0000 http://www.xaprb.com/blog/?p=180#comment-1058 REPLACE does not do an update, it completely replaces the original row(s).

]]>