Home / Companies / Checkly / Blog / Post Details
Content Deep Dive

How I decimated Postgres response times for my SaaS

Blog post from Checkly

Post Details
Company
Date Published
Author
Tim Nolet
Word Count
1,498
Company Posts That Month
4
Language
English
Hacker News Points
-
Post removed?
No
Summary

The Checkly team recently optimized a Postgres query crucial to their dashboard, reducing response times from an average of ~100ms with peaks to a steady 1ms to 10ms. The optimization involved analyzing performance issues, testing fixes, and applying simple Postgres optimizations. A key finding was that two queries were consuming most of the execution time, one of which could be improved by using a composite index on `checkId` and `startedAt` fields in descending order. This solution resulted in a significant reduction in response times and p95 metric value, with Heroku metrics showing a drop from ~3 seconds to 175ms. The optimization was made possible by leveraging tools such as Heroku's pg:outliers command and Postgres' graphical interface for slowest execution time tab. The experience highlights the importance of finding the right angle, testing data, and confirming hypotheses in performance fixes.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.