MySQL performance DELETE or UPDATE?

前端 未结 5 1662
旧巷少年郎
旧巷少年郎 2021-02-14 22:14

I have a MyISAM table with more than 10^7 rows. When adding data to it, I have to update ~10 rows at the end. Is it faster to delete them and then insert the new ones, or is it

5条回答
  •  旧巷少年郎
    2021-02-14 23:03

    using an update where Column='something' should use an index as long as the search criteria is in the index (whether it's a seek or scan is a completely different issue).

    if you are doing these updates a lot but dont' have an index on the criteria column, i would recommend creating an index on the column that you are using. that should help speed things up.

提交回复
热议问题