count_unprocessed_raw fired seven separate COUNT(*) scans on the contacts table every 2 s refresh (total, terrain, hrrr, weather, iemre, radar, all-done). Each one went through the 58k+ row table independently, so the status page was hitting Postgres with ~3.5 full scans per second of connected viewer time. A single query with COUNT(*) FILTER clauses pulls every count in one sequential scan. Same result, roughly 1/7 the CPU on Postgres. |
||
|---|---|---|
| .. | ||
| microwaveprop | ||
| microwaveprop_web | ||
| mix/tasks | ||
| microwaveprop.ex | ||
| microwaveprop_web.ex | ||