Thursday, November 06, 2014

database: nearest point query

years back, my team deployed a web service that gives location description, given a point. since we have a large number of points (about 600k) we decided to segregate areas in polygons and assign a point per polygon. that dropped the number of points (to about 200k) and made a faster query.

early this year, my team deployed a web service that translates requests and responses of another service to a different format. i was surprised when i learned that this service is processing transactions 100 times more than the first service at a much lower processing load.

well, of course they have different processes, but that made me want to improve the first service. with much reading, i drafted a design that makes subsets of the main data set and uses a look-up for mapping. this will mean having two queries, instead of one. but it'll have much quicker queries at that.


then i got to read somewhere that it's similar to what spatial database functions do. so i checked if spatial queries are really faster than my normal distance queries. guessed right, they are.

spatial database is an easy solution for faster nearest point queries! now i have to plan a harder implementation which involves upgrading my database servers. hahaha sheesh

No comments:

Post a Comment

SSH : No matching host key type found. Their offer: ssh-rsa,ssh-dss

Got this while connecting to my mikrotik router via ssh   Unable to negotiate with <ip address> port <ssh port>: no matching hos...