Back to blog
Blog·7 min read

Postmortem: tracking down a slow API endpoint in production

xcodelab team·

A customer reported that one dashboard endpoint was taking over two seconds to respond under normal load, while every other endpoint was fast.

We started with request tracing, which pointed to a single database query responsible for almost all of the latency.

The query was doing a full table scan on a join condition that had no supporting index — easy to miss because the table was small in staging but large in production.

Adding the right composite index brought the response time down to under 80ms. The real lesson: test performance-sensitive queries against production-sized data, not staging fixtures.

#debugging#backend#performance