Harmful transactions: too large, long-running, stalled, abandoned
The four kinds of transaction that slow down or freeze a production database: symptoms, queries to find them on MySQL 8.4 and PostgreSQL 16 (tested), fixes in the code, the pool and the database, plus the details people get wrong about SET TRANSACTION and autocommit.