The Performance Regression That Lost the Largest Customer
A performance regression that loses a large customer almost never happens in isolation. It is the product of a CI pipeline that only checks correctness, a monitoring setup that alerts on errors not latency, and a customer whose data size or usage patterns are meaningfully different from the rest of the user base. The regression was usually introduced weeks before the customer noticed it, and the detection failure is where the real postmortem begins.
Written by Yashveer Singh, founder of Yashveer Labs.
What you actually need to know
- Performance regressions that lose large customers almost always have a detection gap at the CI level. The pipeline checked correctness, not speed.
- Large customers are the canary for performance problems because their data volumes are different from the test environment. The regression was always there; they were the first to see it.
- Latency monitoring at p95 and p99 catches performance regressions weeks before a customer complaint. Error rate monitoring does not.
- A slow query log review is one of the most high-value, low-effort engineering practices most startups skip until after the first incident.
- The business cost of losing a large customer to a performance regression includes the contract value, the reference value, and the signal it sends to similar prospects in the pipeline.
| Detection Method | Lead Time Before Customer Impact | Effort to Set Up | Catches Gradual Regressions |
|---|---|---|---|
| Customer complaint | Zero (they tell you after the fact) | None | No |
| Error rate alert | Minutes (too late for performance) | Low | No |
| p95 latency alert | Hours to days | Low | Partially |
| Slow query log review (weekly) | Days to weeks | Low | Yes |
| CI benchmark assertions | Before deploy | Medium | Yes |
| Load test at large-customer data volumes | Before deploy | High | Yes |
The core argument
The regression had been in production for three weeks when the largest customer's operations manager opened a support ticket describing their dashboard as "unusably slow." The team investigated. They found the problem within two hours. A query that was correct in all the right ways was doing a full table scan because a migration two weeks earlier had quietly dropped an index. The query had been fast with small datasets. It was catastrophically slow with large ones.
The customer's dataset was fifty times the median. Nobody in development had tested it at that scale. The CI suite had run, all tests green, because the tests checked that the right data was returned. Not how long it took.
I have seen this exact pattern more than once. The index was not there, or the N+1 query was introduced, or the query plan changed after a schema modification. In every case, the problem had been live in production for weeks. The median customer never noticed because their data was small enough that even a poorly performing query returned in a reasonable time. The largest customer noticed because they were the first to hit the performance threshold where the query became unusable.
The postmortem from these incidents is uncomfortable because the failure is distributed. The engineer who introduced the regression was not careless. The reviewer who approved the PR was not negligent. The CI system worked as designed. The failure was architectural: the system had no mechanism for catching performance regressions before they reached production.
The gap between correctness and speed
Most engineering teams have learned to test correctness rigorously. They have unit tests, integration tests, and end-to-end tests. The CI pipeline runs thousands of assertions confirming that the application behaves correctly. Not one of those assertions says "this endpoint should respond in under 500 milliseconds."
That gap is where performance regressions live.
The N+1 problem
An N+1 query is a performance regression introduced when a developer accesses a collection of objects and queries the database once per object rather than once for the collection. The code is correct. The result is correct. The performance is proportional to the size of the collection. Small collections feel fine. Large collections are catastrophic.
The missing index
A database migration adds a column, removes a column, or changes a table structure. The query plan changes. An index that was covering a commonly-used query path no longer covers it. The query that was running in 50ms is now doing a full table scan that takes 4 seconds at median data volumes and 40 seconds at large-customer data volumes. The migration passed all tests. The index absence was not tested.
The query plan divergence
A table grows over time. At a certain data volume, the query planner switches strategies. The query that was using an index starts doing a sequential scan because the planner decided (wrongly, for this case) that the scan was cheaper. This is the hardest regression to catch because it does not correspond to a specific code change. It corresponds to a data volume threshold that the system finally crossed.
What it requires
Catching performance regressions before they reach production requires monitoring at multiple layers.
| Layer | Mechanism | Threshold to Alert | Review Cadence |
|---|---|---|---|
| CI pipeline | Benchmark assertions on critical paths | 20% slower than baseline | Per deploy |
| Production monitoring | p95 and p99 latency per endpoint | 2x baseline | Real-time alert |
| Database | Slow query log | Queries over 500ms | Weekly review |
| Load testing | Realistic large-customer data volumes | Any p95 breach | Pre-release |
Expert opinion
The performance regression that loses a large customer is almost always findable in hindsight, and the finding is always uncomfortable. The slow query was there. The slow query log was not enabled. The p99 latency alert was not set. The load test did not use data at the scale of the customer who noticed the problem. None of these are individual failures. They are a system that optimized for correctness and assumed performance would take care of itself. It rarely does. The teams that catch performance regressions before customers do are the ones that built detection into the process with the same rigor they applied to functional testing. That is not a significant time investment. It is a significant mindset shift.
>
Yashveer Singh, founder of Yashveer Labs
How this played out on a real project
A B2B analytics platform I worked with had a reporting feature that allowed enterprise customers to generate custom reports from their data. The feature worked well for the first twelve months. In month thirteen, a developer added a flexible filter mechanism that added a join to the query. The join was correct. The query was not indexed for the new join path.
The regression was live for six weeks before the largest customer, whose dataset was an order of magnitude larger than the next-largest customer, opened a support ticket. They were not hostile. They had been patient. But the report generation that had been taking 3 to 4 seconds was now taking 45 to 60 seconds, which made the feature effectively unusable for their team.
The technical fix took four hours: identify the missing index, add it, deploy. The business recovery took three months. The customer had already started evaluating alternatives. The account manager ran four follow-up calls over the following quarter to demonstrate the fix and rebuild confidence. The renewal closed, but the contract value did not increase as expected, and the reference relationship the team had been counting on for a larger enterprise pitch was put on hold.
What the team built afterward was a performance regression detection system that ran benchmark assertions against the ten most critical query paths in CI, alongside a weekly slow query log review that was owned by a rotating engineer. Both changes took less than a week to implement. Neither existed before the incident.
Common mistakes
- Testing correctness without testing speed. A test suite that only checks results is half a test suite for any customer-facing data-intensive operation.
- Using development data volumes in load tests. If your median customer has 50,000 records and your largest customer has 2 million, the load test that uses 50,000 records will not find the regression that broke the largest customer.
- Not enabling the slow query log. It is off by default in most configurations. Enabling it takes five minutes. Reviewing it weekly takes thirty minutes. The two worst performance incidents I have seen were in systems where the slow query log had never been enabled.
- Alerting on error rate rather than latency percentile. A query that takes 45 seconds does not generate an error. It generates a slow response that the error monitor does not see. p95 and p99 latency alerts catch this.
- Treating performance work as a cleanup task rather than a preventive discipline. By the time performance is on the cleanup list, a customer has already experienced the degradation.
- Not informing large customers proactively when a known performance issue is found. The customer who discovers a problem themselves and then learns the team already knew about it has a fundamentally worse experience than the customer who was told about it before they noticed.
- Running the postmortem without changing the detection process. A postmortem that identifies a missing index as the root cause and does not result in CI benchmark assertions or slow query monitoring will produce the same incident again.
- Not reviewing the query plan after schema changes. Every database migration that touches a table with significant data volume should be accompanied by an EXPLAIN ANALYZE on the queries that touch that table.
A 30-day performance detection plan
- This week, enable the slow query log in production with a threshold of 500 milliseconds. Assign a rotating engineer to review it every Monday morning. The first review will almost certainly surface something worth addressing.
- Add latency alerts at p95 and p99 for the five most customer-visible endpoints. Set the threshold at 2x the current baseline. This takes a few hours and gives you early warning before customers notice degradation.
- Identify the three to five queries or operations that are most sensitive to data volume. These are the candidates for CI benchmark assertions. Write a benchmark test for each one that asserts the response time stays under a defined threshold. Set the threshold conservatively.
- Run a load test using data volumes that represent your largest customer, not your median customer. If you have never done this, the first run will be revealing. Document what breaks at scale and prioritize it.
- Build an index review into the deployment process for any migration that modifies a table over a certain size threshold. An EXPLAIN ANALYZE on affected queries before and after the migration catches index regressions before they reach production.
- Review the three-hour performance audit framework and schedule one for the current quarter. The combination of the slow query log, the p95 trend analysis, and the query plan review for the top ten endpoints gives a complete picture of where the performance risk currently lives. Pair this with the real numbers behind a fast web app in 2026 to establish concrete latency targets before the next audit begins.
Frequently asked
The engineer behind this page
This was written by Yashveer Singh. Full stack developer, founder of Yashveer Labs, currently in Class 12 in New Delhi, shipping production systems while most of my peers are still writing their first console app. I am pointing the work, on purpose, at machine learning, AI engineering, and cybersecurity. If you are reading this because you want to hire someone who will not waste your time or your money, that is the role I am built for.
Posts that line up with this one.
- Startup Failure Postmortems and Fear
The Engineer Who Left a Year of Bug Fixes Behind
A postmortem on the silent damage an engineer carries when they leave without handing off what they know. What actually gets lost, why bus factor kills quietly, and how to build teams that survive a departure.
- Startup Failure Postmortems and Fear
The Vendor Outage That Tested Your Disaster Plan
A postmortem on a third-party vendor failure that exposed a startup's missing disaster recovery plan. What broke, who owned nothing, and how the business relationship with customers changed permanently.
- Startup Failure Postmortems and Fear
The Wrong Tech Stack Decision That Compounded for Three Years
A postmortem on a technology choice made at the beginning of a startup that became increasingly expensive to live with. What the team optimized for, what they should have optimized for, and how long the cost kept compounding.
- Startup Failure Postmortems and Fear
The Side Project That Became the Main Project (and the Reverse)
Two stories that look opposite and are actually the same. The thing you built on the side took off and ate your main thing. The main thing you built faded and the side thing carries you. Both are about paying attention to what is working.