TECH NEWS
The Hidden Cost of Postgres Constraints at Scale
Your ingest workers are queuing. pg_stat_activity shows lock waits. The blocked query is not a slow SELECT. It's your bulk INSERT, waiting on the devices table. You added a FOREIGN KEY there months ago. You added a UNIQUE constraint on the readings table to catch duplicates.