Bluehost.com Web Hosting $6.95

Performance of REPLACE vs ON DUPLICATE KEY UPDATE

This is a discussion on Performance of REPLACE vs ON DUPLICATE KEY UPDATE within the MySQL Database forums, part of the Database Forums category; Can anyone advise me on which has better performance: - REPLACE or - UPDATE ... ON DUPLICATE KEY UPDATE Many thanks Andrew http://...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-02-2007
Andrew2006
 
Posts: n/a
Default Performance of REPLACE vs ON DUPLICATE KEY UPDATE

Can anyone advise me on which has better performance:

- REPLACE or
- UPDATE ... ON DUPLICATE KEY UPDATE

Many thanks

Andrew

http://dev.mysql.com/doc/refman/5.0/en/replace.html

http://dev.mysql.com/doc/refman/5.0/...duplicate.html

Reply With Quote
  #2 (permalink)  
Old 02-02-2007
Andrew2006
 
Posts: n/a
Default Re: Performance of REPLACE vs ON DUPLICATE KEY UPDATE

Sorry... That should have been:

INSERT ... ON DUPLICATE KEY UPDATE


On Feb 2, 10:58 am, "Andrew2006" <mymate...@googlemail.com> wrote:
> Can anyone advise me on which has better performance:
>
> - REPLACE or
> - UPDATE ... ON DUPLICATE KEY UPDATE
>
> Many thanks
>
> Andrew
>
> http://dev.mysql.com/doc/refman/5.0/en/replace.html
>
> http://dev.mysql.com/doc/refman/5.0/...duplicate.html



Reply With Quote
  #3 (permalink)  
Old 02-02-2007
Captain Paralytic
 
Posts: n/a
Default Re: Performance of REPLACE vs ON DUPLICATE KEY UPDATE

On 2 Feb, 11:01, "Andrew2006" <mymate...@googlemail.com> wrote:
> Sorry... That should have been:
>
> INSERT ... ON DUPLICATE KEY UPDATE
>
> On Feb 2, 10:58 am, "Andrew2006" <mymate...@googlemail.com> wrote:
>
>
>
> > Can anyone advise me on which has better performance:

>
> > - REPLACE or
> > - UPDATE ... ON DUPLICATE KEY UPDATE

>
> > Many thanks

>
> > Andrew

>
> >http://dev.mysql.com/doc/refman/5.0/en/replace.html

>
> >http://dev.mysql.com/doc/refman/5.0/...uplicate.html- Hide quoted text -

>
> - Show quoted text -


I don't know about performance, but they will do slightly different
things, especially with timestamp columns

Reply With Quote
  #4 (permalink)  
Old 02-02-2007
Andrew2006
 
Posts: n/a
Default Re: Performance of REPLACE vs ON DUPLICATE KEY UPDATE

There is some discussion on this on the web:

http://www.mysqlperformanceblog.com/...-replace-into/
Quote: "I do not have benchmarks with Innodb but I'd expect them to be
close. I'd mostly look at what makes more sense for your application
from development standpoint."

http://www.feedblog.org/2006/07/using_on_duplic.html
Quote: "Replace actually DELETEs and then INSERTS the row again which
causes 2x the IO."

On Feb 2, 11:01 am, "Andrew2006" <mymate...@googlemail.com> wrote:
> Sorry... That should have been:
>
> INSERT ... ON DUPLICATE KEY UPDATE
>
> On Feb 2, 10:58 am, "Andrew2006" <mymate...@googlemail.com> wrote:
>
> > Can anyone advise me on which has better performance:

>
> > - REPLACE or
> > - UPDATE ... ON DUPLICATE KEY UPDATE

>
> > Many thanks

>
> > Andrew

>
> >http://dev.mysql.com/doc/refman/5.0/en/replace.html

>
> >http://dev.mysql.com/doc/refman/5.0/...duplicate.html



Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 05:11 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0