John, Harrison,

----- Original Message ----- From: "John McCaskey" <[EMAIL PROTECTED]>
Newsgroups: mailing.database.myodbc
Sent: Friday, December 17, 2004 3:33 AM
Subject: Re: Relative efficiency (in terms of disk io) between REPLACE and



Ahhh, thats very good to know.  Thank you.

On Wed, 2004-12-15 at 19:09 -0500, Harrison Fisk wrote:
No.

In InnoDB an UPDATE is done as a DELETE/INSERT internally because it
is
multiversioning and it has to be able to rollback in case of a
problem.
  So the UPDATE effectively does the same thing as the REPLACE that
hits
a problem.   I would most likely stick with REPLACE since it is a bit
easier to understand how it is working and has less client code.

I would like to correct that REPLACE in MySQL is semantically equivalent to a DELETE + INSERT, but internally MySQL often performs it as an UPDATE.


As Harrison noted, with REPLACE you can save in client/server communication, and therefore REPLACE is usually more efficient.

Note also that InnoDB buffers ibdata pages in its buffer pool. Calculating disk I/O for a certain workload is not easy.

Regards,

Harrison
--
John A. McCaskey
Software Development Engineer
Klir Technologies, Inc.
[EMAIL PROTECTED]
206.902.2027

Best regards,

Heikki Tuuri
Innobase Oy
Foreign keys, transactions, and row level locking for MySQL
InnoDB Hot Backup - a hot backup tool for InnoDB which also backs up MyISAM tables
http://www.innodb.com/order.php




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to