sql - User Spatial Point column OR not in MySQL for Performance -
i using mysql in application store list of cities. each long/lat represent center of city.
i want able pull cities close specific city distance of x kilometers.
my question performing faster purpose.
- using point column, , use "spatial" queries retrieve data ?
or
- using float longitude column , float latitude column. , use java code generate long/lat between distance before running sql between query on values .
another small question have, make sense request cities 10 kilometers new york. when new york range bigger 10 kilometers?
spatial extension better in case, since it's based on r-tree indexes, optimized range search in n-dimensional space.
whereas native mysql indexes b-tree , in best case 1 field index used (for range comparison), or no index @ (in case if use advanced geo formulas in answer).
Comments
Post a Comment