0

I have the following table: Position(x, y, t, userid)

Is it any more effective implementation / data structure to retrieve positions which are close to the position of a specific user walked over a day than the naive implementation I imagined?

This is my pseudo code:

loop all the t (time)
    query x0, y0 position of specific user in t
    query all x, y position close to x0, y0
János
  • 32,867
  • 38
  • 193
  • 353
  • 2
    Which DBMS are you using? –  Nov 25 '16 at 11:55
  • I have not jet decided, maybe mongodb, maybe sqlite – János Nov 25 '16 at 11:55
  • For GIS stuff Postgres + PostGIS is usually the best choice. –  Nov 25 '16 at 11:56
  • Or another dbms with native gis support... – jarlh Nov 25 '16 at 11:56
  • now I see I have tree option: MongoDB 2.4, MySQL 5.5, PostgreSQL 9.2, but u said `PostgreSQL` support GIS stuff – János Nov 25 '16 at 12:01
  • If you go for Postgres use the current version 9.2 is pretty outdated. And PostGIS is apparently one of the best GIS options for relational databases. I think there is a reason that OpenStreetmap uses it –  Nov 25 '16 at 14:31
  • See, e.g. here https://boundlessgeo.com/2011/09/indexed-nearest-neighbour-search-in-postgis/ or here: http://gis.stackexchange.com/questions/91765/improve-speed-of-postgis-nearest-neighbor-query or here: http://stackoverflow.com/q/5111843/330315 for example queries –  Nov 25 '16 at 14:55

0 Answers0