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://...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
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 |
|
|||
|
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 |
|
|||
|
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 |