ProximitySearch NearestNeighbor
The actual query pattern: 'find the k nearest providers to this point' or 'find all providers within N km' — built on top of geospatial indexing.
Why we need this / what value this brings
This is the actual user-facing feature ('services near me') — everything else in this folder exists to make this query fast.
When to use this
Any 'browse/search nearby' UI — the core interaction of a local-services marketplace.
How to use or implement this
Use PostGIS's ST_DWithin for radius search or <-> (KNN operator) for 'N nearest', backed by a GiST index, rather than fetching all rows and filtering in application code.
Research questions
- Nearest-neighbor vs radius search — which does Localz's 'browse nearby services' feature actually need, and does the current query express that correctly?
Empty folder — drop notes, links, and findings here as you research.