GitLab

Why we spent the last month eliminating PostgreSQL subtransactions

Sep 29, 2021Grzegorz Bizon
Why we spent the last month eliminating PostgreSQL subtransactions
SummaryAI, from the source post

This post details the debugging and resolution of performance issues caused by PostgreSQL subtransactions, specifically the `SAVEPOINT` SQL query, which was found to cause stalls on database replicas and impact CI/CD job processing. The team developed new instrumentation to track subtransactions and identified that the `SubtransControlLock` was the bottleneck. The fix involved eliminating all `SAVEPOINT` queries from the codebase.

More from the Database Migration Debugging and Cross-Database Compatibility trail