Link to home
Create AccountLog in
Avatar of infodigger
infodigger

asked on

mySQL and spatial data. How to search?

Hello,

I have a huge table of millions of records with id, lat, long.

I am using the havershine formula to search and find records that are near a certain lat,long combination however this takes a lot of time. I have an index on both fields (lat,long) but doesn't seem to do the work.

I have read that I should use partitioning but I also know that mySQL has introduced some spatial classes.

Any ideas on which way is the most effective to do this? Also any example would be highly appreciated!

Thanks a lot!
ASKER CERTIFIED SOLUTION
Avatar of johanntagle
johanntagle
Flag of Philippines image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.