Databases · Middle · Question 23 of 75
Why are long-running transactions harmful in PostgreSQL?
- ✓Correct answer: They hold locks and prevent VACUUM from removing old row versions, so tables bloat and other queries wait
- 2They use more CPU than short ones
- 3PostgreSQL limits transactions to 1 minute
Explanation
Don't keep a transaction open while calling external APIs or waiting for user input. Monitor pg_stat_activity for 'idle in transaction' sessions.