Postgres & ActiveRecord tools
Most Postgres incidents in a Rails app are not about slow queries. They are about waiting: a migration queued for a lock behind a long report, two transactions updating the same rows in opposite order, a pool with fewer connections than the threads asking for them.
These tools answer those questions directly. Paste the error you were handed, or the statement you are about to run, and see which lock is involved, who is waiting for whom, and what to change. Everything runs in this tab; nothing you paste is sent anywhere.
- Postgres Lock Mode LookupLook up the table lock a Postgres statement or Rails migration takes, and check whether one statement waits behind another.
- Postgres Deadlock AnalyzerPaste a Postgres deadlock report and see the wait cycle, the lock pattern behind it and the fix. Runs in your browser.
- Sidekiq & Puma Connection Pool CalculatorSize your Rails database pool against Puma threads and Sidekiq concurrency, and check total connections against Postgres max_connections.