Performance of Delete/Insert vs. Update
Posted on 2012-03-14
In looking at objects that are a high load on our database I found a Stored Procedure that is has the highest CPU usage on our system and it is a simple procedure that based on 5 parameters it deletes the record based on the 2 key fields (Unique) and then does an insert of a record with the 5 parameter fields (which match the columns in the table.
To me I though this is inefficient and it should be only doing an insert if the row is not found, otherwise doing an update.
How can I best test this out or know if I am correct?
The table has over 10 million rows with three indexes.