View Single Post
Old 12-15-2008, 12:16 AM  
borked
Totally Borked
 
borked's Avatar
 
Industry Role:
Join Date: Feb 2005
Posts: 6,284
Quote:
Originally Posted by mrkris View Post
The real question is, how long does it take to run.
Table info:
geo_data 6,668,045 INNODB latin1_swedish_ci 1.5 GiB

On a query with a polygon covering 100 miles around my location
query:

SELECT name, country, region, latitude, longitude
FROM geo_data
WHERE place_type = 'P'
AND place_code = 'PPL'
AND alternate_names != ''
AND INTERSECTS( GEOMFROMTEXT( 'POLYGON((44.7473228148 5.4,43.2827760916 7.38832741803,41.8526751852 5.40000010412,43.2827759366 3.41167258704,44.7473228148 5.4))' ) , GEOMETRY )
ORDER BY SQRT( POW( ABS( X( GEOMETRY ) - X( GEOMFROMTEXT( 'POINT(43.299999 5.400000)' ) ) ) , 2 ) + POW( ABS( Y( GEOMETRY ) - Y( GEOMFROMTEXT( 'POINT(43.299999 5.400000)' ) ) ) , 2 ) )
LIMIT 0 , 30

Run time:
Showing rows 0 - 29 (2,468 total, Query took 0.0826 sec)


ooooh yeah
__________________

For coding work - hit me up on andy // borkedcoder // com
(consider figuring out the email as test #1)



All models are wrong, but some are useful. George E.P. Box. p202
borked is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote