ML Integration: - Load trained model at app startup, cache compiled predict fn in persistent_term - Grid worker uses batched ML prediction (10K chunks) when model loaded, falls back to algorithm scorer when not - ML score replaces composite, algorithm factor scores preserved for detail view - Fix process explosion: single EXLA call per chunk instead of per-grid-point QSO Features: - Callsign search (ILIKE on station1/station2) with trigram indexes - Reciprocal QSO grouping (same pair, same band, same hour) - Wider layout (max-w-7xl) for data table pages - QSO Training Data link on map page Infrastructure: - Re-enable hourly propagation grid worker in dev - Track ML model weights in git for Docker builds - Add btree indexes on qsos (timestamp, band, distance_km) - Remove nav icons from layout header
26 lines
860 B
Elixir
26 lines
860 B
Elixir
defmodule Microwaveprop.Repo.Migrations.AddTrainingPerformanceIndexes do
|
|
use Ecto.Migration
|
|
|
|
def change do
|
|
# QSO training data queries filter on timestamp + distance + positions
|
|
create_if_not_exists index(:qsos, [:qso_timestamp])
|
|
create_if_not_exists index(:qsos, [:band])
|
|
create_if_not_exists index(:qsos, [:distance_km])
|
|
|
|
# Callsign search: trigram index for ILIKE on station1/station2
|
|
execute(
|
|
"CREATE EXTENSION IF NOT EXISTS pg_trgm",
|
|
"SELECT 1"
|
|
)
|
|
|
|
execute(
|
|
"CREATE INDEX IF NOT EXISTS qsos_station1_trgm_index ON qsos USING gin (station1 gin_trgm_ops)",
|
|
"DROP INDEX IF EXISTS qsos_station1_trgm_index"
|
|
)
|
|
|
|
execute(
|
|
"CREATE INDEX IF NOT EXISTS qsos_station2_trgm_index ON qsos USING gin (station2 gin_trgm_ops)",
|
|
"DROP INDEX IF EXISTS qsos_station2_trgm_index"
|
|
)
|
|
end
|
|
end
|