Am I correct to assume that an UPDATE query takes more resources than an INSERT query?
Am I correct to assume that an UPDATE query takes more resources than an
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I am not a database guru but here my two cents:
Personally I don’t think you have much to do in this regard, even if
INSERTwould be faster (all to be proven), can you convert an update in an insert?! Frankly I don’t think you can do it all the times.During an
INSERTyou don’t usually have to useWHEREto identify which row to update but depending on your indices on that table the operation can have some cost.During an update if you do not change any column included in any indices you could have quick execution, if the where clause is easy and fast enough.
Nothing is written in stones and really I would imagine it depends on whole database setup, indices and so on.
Anyway, found this one as a reference:
Top 84 MySQL Performance Tips