1

Im porting an application from mysql to postgres, and have several tables with 500k+ rows in each of geo points (lat, lon). In mysql i used a bounding box query with haversine to select rows within a given distance of a center point. i understand i can use either postgis's st_dwithin or the earthdistance module (or i could probably port my mysql query over too). Just wondering if anyone has a recommendation on which method would be best performance wise with these large data sets.

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Sep 2, 2014 at 2:42

1 Answer 1

1

Use st_dwithin. It will use the spatial index and do the job very fast if it is only points. 500 000 points is not that much.

answered Sep 2, 2014 at 8:47

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.