Tech article

Sixteen Locks Ought to Be Enough for Anybody

No preview is available. Read the original article for the full story.

Hacker News | Sep 14, 2026 | speckx

Automated excerpt

When PostgreSQL plans a query, it takes AccessShareLock on every relation the query might use. So a table with a primary key and 20 secondary indexes costs 22 relation locks per query: the table, the primary key index, and the 20 others the planner examined and discarded. If a query needs more than 16 relation locks, the overflow goes through the shared lock table, LWLocks and all.

Selected automatically from source text; not independently written or fact-checked. Read the original for full context.

Read the original article

More tech news