I need to overwrite entries in a mysql table if the entry already exists. The method I used for doing this is to just send a query that deletes any row that matches some of the rows fields regardless if it exists or not. For example:
request was given to add John Doe to the table
delete from table where name = "John Doe"
insert into table.... "John Doe"
I was wondering if it was better for me to check if the record exists before sending a delete command. Or should I actually use an alter command? If I use an alter command I still have to check if it exists. I'm going for speed.