私は5つのテーブルを持っています:
- 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.
現在のユーザーの近くにいる友達を見つけたいのですが、ユーザーが友達かどうかを知るために select クエリを実行し、その後 select using を実行するのに時間がかかりますST_DWithin
。ドメイン モデルまたはクエリに何か問題がある可能性がありますか?