We are working on a ride sharing service, where we are using PostgreSQL as our database management system to store ride details. We haven't used any special datatypes for storing our latitude and longitude info, but are currently saving them as string objects. In order to improve the performance of our search queries on geolocation data, could we use PostGIS or is there any other location-related support from PostgreSQL? Something to improve the database's performance in a situation like this? (We are using Django btw.)
Our data would look something like this:
Ride1
starts from pointA(lat,long)
and goes to pointB(lat,long)
with routePoints(lat,long)(lat,long)
... along the way.
We need to perform complex queries on this data, for example:
- Who is travelling from
pointA1
which is 5% of the total distance from A->B? and - Is there a point in the route points array that coincides with the location of someone else to the user could pick them up?
Thanks for reading through this. Please help me out in choosing the best database architecture for the geolocation querying system described above.