GetScopeStats left-joined packets, observer_scopes and nodes at once,
multiplying rows into the millions before COUNT(DISTINCT) deduped them
(~10s per call). Count each table on its own and index packets(scope_id).
Refresh last_heard on duplicate observations too, capped at hourly, so
steady traffic can't age a trace out of the filter (dedup key has no
heard_at). Drop the unused last_heard index column so upserts stay HOT,
and share one retention cutoff across the cleanup deletes.
The trace list joined every trace packet to ~50M observations to apply
the IATA filter; the parallel hash join overran docker's 64MB /dev/shm
and the filtered list errored. Keep a small trace_iatas table at ingest
(like channel_iatas) and group packets by tag instead. Filtered stats
are now per tag rather than per matching packet.
Refresh last_heard on duplicate observations too, capped at hourly, so
steady traffic can't age a channel out of the filter while its packets
stay retained (dedup key has no heard_at). Guard the seed join against
the docker /dev/shm cap like the trace one, and drop the unused
last_heard index column so the upserts stay HOT.
The IATA filter ran a correlated EXISTS over packets/observations with
ILIKE, which skipped the iata index and took ~7s live. Keep a small
channel_iatas table at ingest (like node_iatas) and filter against it.
Also honor the iatas= param so multi-site regions stop getting the
global list. Filter now ages out with packet retention rather than
matching any retained packet.
Quiet sites probed hundreds of thousands of packets to fill a page.
Walk idx_observations_iata_heard per requested site and dedup instead.
Filtered lists now order by site-local recency; the cursor follows.
text[] from string_to_array can't match the CHAR(3) indexes and hides
the values from the planner. Handlers already have a slice; stop
joining to CSV in the store layer and pass a typed array everywhere.
this was causing duplicates and each obersver heard a given
packet hash or it didn't, there are not more observations of
the same hash from one observer
UpsertIATADetails was a plain UPDATE that silently affected zero rows
when the iata_codes row did not yet exist. Adding a new IATA to the
config for the first time resulted in display_name, approx_lat, and
approx_lng remaining NULL.
Change the query to INSERT ... ON CONFLICT DO UPDATE so the row is
atomically created (if missing) or updated (if present), matching the
function's name and the pattern used by UpsertTransportScope.
any route observer where all hops are high confidence
are now stored and available at /routes
you can also search for a src dest route and it will
return any recored route subset that can link the src
and dest hash
new config for transport scope keys seeded to db
new transport keystore to lookup matching keys and tag
- packets with scope key
- nodes with default scope
- observers with all supported scopes it forwards
allow filtering by region scope key on: packets, nodes, observers