mysql テーブルに 2063 の場所が保存されています。私のプロセスの 1 つで、特定の結果が特定の起点からどれだけ離れているかに基づいて、特定の結果を除外する必要があります。問題は、一度に数百、おそらく数千の結果をフィルタリングする必要があることです。
では、距離計算を行う最良の方法は何でしょうか。実行時にやるべきか
1. Find all points connecting to my point of origin
2. loops through the connecting points
3. calculate the distance between the point of origin and the connecting point
4. exclude the connecting point if the distance if too great
または、すべてのポイント間の距離が既にわかっているルックアップ テーブルを作成する必要があります。p1 と p2 の間の距離は p2 と p1 の間の距離と同じであるため、行の重複を避けることができますが、それでもテーブル内に数百万行が存在することになります。
または..それを行うより良い方法はありますか?