Deep dive into SKIP LOCKED in MySQL

Over the past few months, my team has been building some high performance systems that has leveraged MySQL's SKIP LOCKED feature.

Below is a collection of learnings about SKIP LOCKED that I wish was available when we just started with the project.

  • innodb and the scan

    • keep the table small
  • secondary indexes == more locks

  • supremum locks

    • use read committed

https://github.com/percona/percona-server/commit/7f958f58dea1f3477839d0945222195f20145dfb

https://planetscale.com/blog/btrees-and-database-indexes

Written in September 2024.
Kir Shatrov

Kir Shatrov helps businesses to grow by scaling the infrastructure. He writes about software, scalability and the ecosystem. Follow him on Twitter to get the latest updates.