The side quest that freed 10% of our database
A single lateral-join query answering "who's on call for this rotation layer right now" consumed 34% of incident.io's Postgres replica CPU.
A single lateral-join query answering "who's on call for this rotation layer right now" consumed 34% of incident.io's Postgres replica CPU.
Using a SAVEPOINT per tick in a Postgres-backed job queue made every locked row carry a MultiXact ID in xmax.
incident.io's on-call schedule renderer, which computes future shifts on the fly from rotation config, working hours and fair-scheduling rules, became dramatically faster through a series of fixes culminating in a ~2,500x speedup.
incident.io cut P95 latency of its alert-filtering API for large organisations from 5s to 0.3s by pushing JSONB attribute filters into Postgres using bloom filters.
incident.io cut latency of an LLM prompt that plans Grafana dashboards for incident investigations from 11s to under 2.3s without changing its behaviour, mainly by shrinking output tokens.
incident.io cut its incident chatbot's response latency by about 50% (saving 2-3s per interaction) by speculatively executing LLM tool calls in both directions.
Postgres indexes pay off for frequently run queries that discard most rows they read, need results in a specific order, or must enforce uniqueness.
incident.io sped up builds of its Go monolith by tracing the compiler with `go build -debug-trace` and viewing the output in Perfetto.
incident.io built a custom Go hot-reloader that records build telemetry (platform, memory, power source, Go build stages, triggering files) from developer MacBooks and pipes it through Fivetran into BigQuery.
incident.io cut a Go code-generation step from about 16 seconds to under half a second (97% faster) by adding commonly used imports directly to the generator's template.
Intermittent API timeouts at incident.io over two weeks traced back to requests blocking on Go's database/sql client-side connection pool, with no single slow query or pool to blame.