sql: DELETE + INSERT vs UPDATE + INSERT

后端 未结 7 1675
花落未央
花落未央 2021-01-19 02:29

A similar question has been asked, but since it always depends, I\'m asking for my specific situation separately.

I have a web-site page that shows some data that co

7条回答
  •  走了就别回头了
    2021-01-19 03:17

    TRUNCATE will be faster than delete, so if you need to empty a table do that instead

    You didn't specify your RDBMS vendor but some of them also have MERGE/UPSERT commands This enables you do update the table if the data exists and insert if it doesn't

提交回复
热议问题