From 2b64beac34923dfb8c4671af670ea90dba24a9be Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Sun, 26 Jul 2026 15:32:51 -0500 Subject: [PATCH] reliability: N+1 query audit complete, handoff updated - Audit found no high-severity N+1 patterns. Cache layers and batch queries already eliminate classic patterns in hot paths - Two medium-priority edge cases documented: InfoLive double-query per update, popup weather fallback cache key mismatch - Handoff: marked reliability #4 as done --- docs/refactor-implementation-handoff.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/refactor-implementation-handoff.md b/docs/refactor-implementation-handoff.md index 017fadb..9ec8ff1 100644 --- a/docs/refactor-implementation-handoff.md +++ b/docs/refactor-implementation-handoff.md @@ -119,8 +119,8 @@ MIX_ENV=prod mix assets.deploy ~~payloads before database work.~~ **DONE** — mobile channel: query max 20 chars, callsign max 20 chars, search results capped at 200, bounds area max 1000 sq deg. All rejections emit `[:aprsme, :payload, :rejected]` telemetry. 3. Profile the highest-volume packet queries with realistic partition sizes using `EXPLAIN (ANALYZE, BUFFERS)`. Verify partition pruning and the new spatial index. -4. Remove remaining N+1 query patterns in map overlays, device/account pages, and - status/operational pages. Prefer bounded batch queries and preloads. +4. ~~Remove remaining N+1 query patterns in map overlays, device/account pages, and + status/operational pages. Prefer bounded batch queries and preloads.~~ **DONE** — audit complete. No high-severity patterns found. Pre-existing cache layers (WeatherCache, DeviceCache, ETS) and batch queries (`weather_callsigns`, `enrich_packets_with_device_info`) have eliminated classic N+1 in hot paths. Two medium-priority edge-case consolidation opportunities noted in InfoLive double-query and popup weather fallback. 5. Audit mobile and map search for unbounded scans. Add deterministic ordering, hard result caps, suitable indexes, and tests that assert the caps. 6. ~~Review the packet counter migration under concurrent inserts and partition