On Mon, Nov 30, 2026 at 5:13 AM Laurenz Albe <[email protected]> wrote:
> On Sun, 2026-11-29 at 23:28 -0500, Justin wrote: > > Use of explicit locking is highly discouraged. > > I have to disagree with that. I'd say it depends a lot on your use case. > If collisions are frequent, optimistic locking will lead to a lot of > transactions being repeated, which hurts performance and throughput and > creates more work for autovacuum. > As long as the transactions are short, pessimistic locking is a better > approach in that case. > > > Why is the application repeating work that explicit locking would block? This means the application has to be written in a manner to detect the explicit locks. I would like a better explanation on what type of workload you're referring to where explicit locking is a benefit. I am not against use of explicit locking however it should be reserved for specific use cases such as order of operations or for work tables that are used track parallelization
