Find users quickly using PostGIS
I have 5 tables:
- users - information about user with current location_id (fk to geo_location_data)
- geo_location_data - information about location, with PostGIS geography(POINT, 4326) column
- user_friends - relationships between users.
I want to find close friends for the current user, but it takes a long time to execute the select query to find out if the user is a friend and then select with ST_DWithin
. Is there something wrong with the domain model or the queries?
+2
a source to share