Add PostgresMarathon 2-008: LWLock:LockManager and prepared statements
Description
Deep dive into how prepared statements reduce lock contention by analyzing planner locks vs executor locks.
Key findings:
- Explains why locking behavior changes on 7th execution, not 6th
- Includes PG18 source code analysis with permanent commit links
- Demonstrates the mystery of execution 6 using generic plan but still acquiring all locks
Changes
- New blog post:
blog/20251014-postgres-marathon-2-008.mdx
- Cover image:
static/assets/blog/20251014-postgres-marathon-2-008-cover.jpg
- All GitHub links use permanent commit hashes instead of branch references
Key insights
- Prepared statements reduce
LWLock:LockManager
contention starting with 7th execution - Execution 6 uses generic plan but still acquires planner locks (all indexes)
- Execution 7+ uses cached generic plan with executor locks (table only)
Checklist
-
All proposed text changes have been reviewed by an LLM for grammar -
This MR contains text changes and they have been reviewed -
This MR contains no GUI/CLI changes -
This MR contains no API changes