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. |
||
|---|---|---|
| .. | ||
| admin | ||
| beacon_live | ||
| contact_live | ||
| user_management_live | ||
| about_live.ex | ||
| algo_live.ex | ||
| contact_map_live.ex | ||
| import_live.ex | ||
| map_live.ex | ||
| path_live.ex | ||
| privacy_live.ex | ||
| rover_live.ex | ||
| status_live.ex | ||
| submit_live.ex | ||
| user_profile_live.ex | ||
| weather_map_live.ex | ||