Cases1 case
1 to 1 of 1
IL-0317Clerk's Postgres slowed after an automatic analyze flipped a query plan, and over 95% of requests got 429Clerk2026- Symptoms
At 8:11 AM PST (16:11 UTC) on 19 February 2026, Clerk's database performance dropped at once. Slow database queries made request handlers queue, and over 95% of traffic was answered with 429 without being handled; the small share of requests that reached the database returned 200, but extremely slowly.
- Trigger
A routine automatic ANALYZE on one table sampled only NULL values in a column, and the Postgres planner switched a frequently run query to an inefficient plan.
- Root cause
- Component
- Contributing factor
- Detection
The incident was reported and escalated internally at 16:15 UTC, and the team started a group call.
- Remediation
- Enabled a new failover that generates session tokens outside the core Session API
- Re-ran ANALYZE manually on the affected table, which put the query back on its earlier plan
- Disabled the failover once the database was back to healthy levels
- Increased the statistics target on the table so the planner samples more rows
- Refactored the query so the planner could plan it deterministically
- Action items
- Add dedicated alerting for database query plan flips
- Train the reliability team to enable the new session token failover and add automatic triggers for it
- Audit all queries for others at risk of inefficient plans from unstable statistics
- Name a dedicated communications lead during incidents
- Post status page updates at a regular cadence even when nothing has changed
- Make status page severity labels match the impact on customers
- Cross-post incident updates to social channels
- Lessons
Clerk says a query plan flip can cause sudden, severe degradation and needs to be detected directly instead of through downstream symptoms; relying on those symptoms led the team to blame a customer's traffic pattern. Customers also told Clerk that status page updates came too rarely, the first update came too late and the initial severity label did not match the impact.
This case involves Database and Query planner and table statistics. kubegap audits a Kubernetes cluster for gaps like these, read-only, from Claude Code or Codex; its checks cite public reports like the ones in this library.