Question

I'm curious about write locks with MySQL and how they are prioritized with eachother. Specifically, I'm wondering if "low priority write" locks have lower priority than "normal" write locks, or if they are equal. The only documentation I can find states that the low priority locks have lower priority than read locks, allowing read locks to process first. But I can't find anything that states how they relate to other write locks.

The point of this is that I'm looking for a way to "prioritize" write locks, and wondering if just the standard low priority lock will do what I'm looking for.

Was it helpful?

Solution

The manual has it all:

A request for a LOW_PRIORITY WRITE lock, by contrast, permits subsequent READ lock requests by other sessions to be satisfied first if they occur while the LOW_PRIORITY WRITE request is waiting [to be granted].

Nothing is mentioned about an effect on WRITE lock requests, so the LOW_PRIORITY modifier has no effect on concurrent them.

Beware, though:

The LOW_PRIORITY modifier has no effect as of MySQL 5.5.3

And:

As of MySQL 5.6.5, it is deprecated and its use produces a warning. Use WRITE without LOW_PRIORITY instead.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top