MySQL Forums
Forum List  »  General

REPLACE command
Posted by: Charl Gerber
Date: February 24, 2005 02:10AM

Seeing the online documentation regarding the REPLACE command, I have seen that some people recommend rather doing:

DELETE FROM...
and then
INSERT INTO...

This is always two calls. Wouldn't it be better to rather do
UPDATE ....
and only if this returns 0, then do
INSERT INTO

I have an application where there will be far more updates than actually INSERT's. So it will be far less actual database calls, but how 'expensive' is the UPDATE compared to a DELETE/INSERT?

Or would it just be better to use REPLACE anyway?

Thanks.

Options: ReplyQuote


Subject
Written By
Posted
REPLACE command
February 24, 2005 02:10AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.