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

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -