0

The pic

my objective is layed out on a pic (thought it will be easier ). My curiosity is is,

  1. is it how its done in the real world in the sense of mechanism wise.
  2. if there are millions of rows in that table wouldn't it take so long to make the calculations
  3. list any other options.
  4. what is generally used in the real world to achieve this

thank you for your help.

nbk
  • 45,398
  • 8
  • 30
  • 47
  • This is straightforward to do when you have latitude / longitude data. Your (5 mile) range limit can make it reasonably fast too. Here's a writeup. https://www.plumislandmedia.net/mysql/haversine-mysql-nearest-loc/ – O. Jones Jun 22 '20 at 15:20
  • you can see [here](https://stackoverflow.com/questions/60065116/mysql-request-for-combining-and-searching-in-2-tables/60067302#60067302) a more modern solution to the duplicate but it is in you to find a solution where you can limit the distance or other criteria – nbk Jun 22 '20 at 15:22
  • thanks for the replies. Both solutions calculate the direct distance from point A to point B. How can I associate this solution with google's matrix API which gives the default road distance. which means accessing the matrix API for each record on the service providers table. is there a way to achieve this more efficiently – hemantha kuk Jun 26 '20 at 08:54

0 Answers0