Skip to content
Tech News
← Back to articles

PostgreSQL's 16-slot fast-path lock array can bottleneck heavily-indexed tables

read original more articles
GoKawiil Brief

PostgreSQL takes a weak AccessShareLock on a table and every one of its indexes each time it plans a query, even indexes the plan doesn't end up using. Through version 17, each backend can only record 16 such locks in a private fast-path array before overflowing into the shared lock table, which is guarded by 16 LWLock partitions that become contention points under heavy concurrent load.

Why It Matters

GoKawiil's interpretation of the reporting above, not reported fact.

Tables with many secondary indexes can silently cross this 16-lock threshold, turning simple primary-key lookups into a source of CPU-heavy lock contention as query volume and core counts rise. It's a reminder that index counts have hidden concurrency costs beyond storage and write overhead, and that database internals like fast-path arrays impose real limits developers rarely think about until they hit scale.

Key Takeaways

Source: thebuild.com, 2026-09-14

Published there as: “Sixteen Locks Ought to Be Enough for Anybody”

Read the original report → The summary and analysis above are GoKawiil's own, written from reporting by the source above. Facts and quotes belong to the original publisher.