Home / Questions / Why should Select ForUpdate be avoided when no update is performed?
Explanatory Question

Why should Select ForUpdate be avoided when no update is performed?

👁 9 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

Answer with Explanation

BPCheckSelectForUpdateAbsent warns when select forUpdate is used but no update happens.
This:

  • Locks records unnecessarily

  • Reduces concurrency

Fix:

  • Use normal select, or

  • Enable Optimistic Concurrency Control (OCC) on the table.