List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:August 28 1999 11:32pm
Subject:RE: update? insert? Perl script
View as plain text  
>>>>> "Jay" == Jay Miller <jaymiller@stripped> writes:

Jay> In a case like this we are using REPLACE, which performs a DELETE and
Jay> INSERT.  This is easier than checking first and either UPDATEing or
Jay> INSERTing.  I'm sure it places a higher load on the MySQL server, but it
Jay> takes some off of the client and possibly reduces some network traffic.

Jay> Any thoughts?

Hi!

The load of REPLACE should be much less than an SELECT / DELETE + an
INSERT.

REPLACE is implemented as an INSERT which is rolled back in case of
duplicated keys. The duplicated row is then deleted and then we try
another INSERT..

Regards,
Monty



Thread
update? insert? Perl scriptgl324 Aug
  • Re: update? insert? Perl scriptJeff Beard24 Aug
  • Re: update? insert? Perl scriptPaul DuBois24 Aug
    • RE: update? insert? Perl scriptDan Ray24 Aug
      • Re: update? insert? Perl scriptThimble Smith24 Aug
      • RE: update? insert? Perl scriptgl324 Aug
      • Re: update? insert? Perl scriptScott Hess24 Aug
      • RE: update? insert? Perl scriptPaul DuBois24 Aug
        • RE: update? insert? Perl scriptJay Miller24 Aug
          • RE: update? insert? Perl scriptMichael Widenius29 Aug
        • RE: update? insert? Perl scriptDan Ray25 Aug
  • Re: update? insert? Perl scriptB.W. McAdams24 Aug