SELECT vs UPDATE performance with index

后端 未结 7 1706
有刺的猬
有刺的猬 2020-12-09 04:10

If I SELECT IDs then UPDATE using those IDs, then the UPDATE query is faster than if I would UPDATE using the conditions

相关标签:
7条回答
  • 2020-12-09 04:58

    Most likely the second UPDATE statement locks much more rows, while the first one uses unique key and locks only the rows it's going to update.

    0 讨论(0)
提交回复
热议问题