Need help optimizing a lat/Lon geo search for mysql

后端 未结 5 1554
走了就别回头了
走了就别回头了 2021-01-03 07:09

I have a mysql (5.0.22) myisam table with roughly 300k records in it and I want to do a lat/lon distance search within a five mile radius.

I have an index that cov

5条回答
  •  醉梦人生
    2021-01-03 08:00

    Depending on the number of your listings could you create a view that contains

    Listing1Id, Listing2ID, Distance

    Basically just have all of the distances "pre-calculated"

    Then you could do something like:

    Select listing2ID from v_Distance d where distance < 5 and listing1ID = XXX

提交回复
热议问题