No description
  • JavaScript 96.9%
  • CSS 2.9%
  • HTML 0.2%
Find a file
Matt c8e2568f64 perf(offroute): query_radius uses k-NN <-> ordering for index-supported nearest-neighbor
The old ST_DWithin(50km) scan returned ~226k candidate points near dense areas before
sorting (~3-10s/call). Replace with PostGIS k-NN ordering: ORDER BY geom::geography <->
point LIMIT k, which the existing GiST index on (geom::geography) walks nearest-first and
stops after K rows. SELECT still computes ST_Distance AS distance_m so callers see real
meters. radius_km is kept as a Python soft cap applied after fetch (drops rows beyond it),
preserving the caller expanded-radius fallback (now effectively a no-op).

2 tests: SQL contains <-> + LIMIT and no ST_DWithin; radius_km soft cap filters beyond-cap rows.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 07:28:46 +00:00
backend perf(offroute): query_radius uses k-NN <-> ordering for index-supported nearest-neighbor 2026-05-25 07:28:46 +00:00
frontend feat(navi/ui): wire place.category from osm key:value at all place-creation sites 2026-05-25 03:41:36 +00:00