Measuring SELECT ... FOR UPDATE Latency in PostgreSQL
At Lifen , we love digging into database performance issues. Recently, while monitoring one of our Rails applications using PgAnalyze and specific logging, we noticed something concerning: around 13–16% of a basic but frequently run query was taking more than 100ms to complete… and sometimes up to 1500ms. The culprit? SELECT ... FOR UPDATE queries that were experiencing intermittent slowdowns. The…