Professional Web Applications Themes

Performance of REPLACE vs ON DUPLICATE KEY UPDATE - MySQL

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/en/insert-on-duplicate.html...

  1. #1

    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/en/insert-on-duplicate.html

    Andrew2006 Guest

  2. #2

    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" <com> wrote: 


    Andrew2006 Guest

  3. #3

    Default Re: Performance of REPLACE vs ON DUPLICATE KEY UPDATE

    On 2 Feb, 11:01, "Andrew2006" <com> wrote: 





    >
    > - Show quoted text -[/ref]

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

    Captain Guest

  4. #4

    Default Re: Performance of REPLACE vs ON DUPLICATE KEY UPDATE

    There is some discussion on this on the web:

    http://www.mysqlperformanceblog.com/2007/01/18/insert-on-duplicate-key-update-and-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" <com> wrote: 




    > [/ref]


    Andrew2006 Guest

Similar Threads

  1. MySql UPDATE problem with duplicate rows
    By Jon Maz in forum MySQL
    Replies: 7
    Last Post: May 17th, 09:30 AM
  2. on update / on delete performance of foreign keys
    By Richard Huxton in forum PostgreSQL / PGSQL
    Replies: 7
    Last Post: January 26th, 11:35 PM
  3. Search and replace (super global replace)
    By johnweiffenbach@adobeforums.com in forum Adobe Acrobat Windows
    Replies: 1
    Last Post: April 8th, 08:56 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139