postgres=# select * from sessions where video_id = 'wHMNX-fHb2A';
Observer effect in pg_stat_statements and pg_stat_kcache
Missing and self-hidden I/O accounting in monitoring extensions.
session summary
The group reproduced an observer effect shared by pg_stat_statements and pg_stat_kcache. Reading their hash tables holds a shared lightweight lock while results are materialized; if the tuplestore spills beyond work_mem, the lock may cover temporary-file I/O, blocking registration of new queries. They prototyped conditional lock acquisition for pg_stat_kcache so a query can execute while its statistics entry is skipped. The workaround succeeded in the demonstration, but needed configuration, benchmarks, and confirmation that it addressed the production contention before submission.
timecodes
- Reviewing the committed bounded psql watch
- Observer effects in statistics extensions
- pg_stat_kcache contention at high TPS
- Tracing the shared hash-table lock
- Tuplestore spill extends lock duration
- Reproducing blocked registration of new queries
- Best-effort tracking with conditional locking
- Prototype works, but the production cause remains uncertain