Code RoomHot partition index bloat
HardPrep Room Coding #2771

Hot partition index bloat

On-callDistributed systemsSenior–Staff~35 min

You store metrics/events in a Postgres table partitioned by day (range partitioning on `event_time`). Ingestion is steady but the current day's partition is the write hot spot — and over the past week, write latency on inserts has been creeping up and now spikes badly near peak, even though older partitions are idle. Index bloat on the active partition's indexes looks high, and `pg_stat_user_tables` shows almost all updates/HOT-update misses concentrated there. Autovacuum mostly leaves the hot partition alone during the day. Triage and mitigate.

What a strong answer looks like

Stop the bleeding first (mitigate), then form hypotheses from real signals. Separate root cause from symptom, communicate status as you go, and close with what prevents a repeat.

0:00 of about 35 min
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.