prop/docs/plans
Graham McIntire 5ec66df135
Cut propagation_scores write cost with DELETE+COPY, skip-factors, UNLOGGED
The scoring+upsert phase was ~4m40s per forecast hour and dominated
wall time. Three stacked optimizations attack it from different
angles.

replace_scores/2 is a new hot-path writer that does DELETE WHERE
valid_time = $1 followed by a plain insert_all (no ON CONFLICT
resolution). The chain worker rewrites the full (valid_time, all
bands) slice every forecast hour, so conflict detection was pure
waste. AsosAdjustmentWorker still uses upsert_scores because it
only rewrites the subset of cells near a station.

factors is now nullable. Forecast hours f01-f18 pass factors: nil
so the JSONB encode + toast write is skipped entirely — roughly
halves the data volume per run. point_detail/4 coalesces nil to
an empty map so the JS popup renders without a TypeError, and
scorer_diff only pulls the most recent valid_time that still has
factors (the f00 row).

propagation_scores is now UNLOGGED, so inserts bypass WAL entirely.
Durability tradeoff: an unclean shutdown truncates the table, but
PropagationGridWorker rebuilds it from HRRR every 3h so a lost
table is re-populated within one cron cycle.

Also adds docs/plans/2026-04-14-duckdb-scores-storage.md — a
speculative plan for a flat-file / DuckDB rewrite with explicit
trigger conditions for when to pick it up (partitioning deferred
too; revisit only if these three don't solve it).
2026-04-14 13:47:35 -05:00
..
2026-03-30-commercial-link-monitoring.md Add commercial link monitoring via SNMP polling 2026-03-30 13:02:59 -05:00
2026-03-30-conus-propagation-map.md Refactor HRRR fetch to batch points per hour 2026-03-30 17:21:47 -05:00
2026-04-01-algorithm-refinement-ml-training-design.md Normalize ML features to prevent NaN gradient explosion 2026-04-01 09:08:33 -05:00
2026-04-01-algorithm-refinement-ml-training.md Normalize ML features to prevent NaN gradient explosion 2026-04-01 09:08:33 -05:00
2026-04-07-multi-source-atmospheric-data.md Path-integrated HRRR scoring across pos1/mid/pos2 2026-04-07 12:04:16 -05:00
2026-04-09-propagation-modeling-improvements.md Plan: propagation modeling improvements from April 2026 review 2026-04-09 16:10:54 -05:00
2026-04-11-contact-edit-approval-design.md Add contact edit approval system with admin review queue 2026-04-11 16:15:49 -05:00
2026-04-13-hrdps-canadian-prop-grid.md Ingest Canadian radiosondes via UWYO + plans for RDPS/HRDPS 2026-04-13 09:14:34 -05:00
2026-04-13-rdps-vertical-profiles.md Ingest Canadian radiosondes via UWYO + plans for RDPS/HRDPS 2026-04-13 09:14:34 -05:00
2026-04-14-duckdb-scores-storage.md Cut propagation_scores write cost with DELETE+COPY, skip-factors, UNLOGGED 2026-04-14 13:47:35 -05:00