MySQL Forums
Forum List  »  Performance

Re: Implementing distance matrix 2500 X 2500
Posted by: Peter Zaitsev
Date: December 15, 2004 01:26PM

Which kind of performance do you need ?

Suggestion to store it as (from_id,to_id, distance) table is a good one.
Also if you'll have key on (from_id,distance) you will be able to retrieve places in proximity of current one pretty quickly.

If your application needs only limited distance, (ie who would look for a shop located more than 200 miles away ?) you can purge the table by deleting rows
with longer distances.

There is also new solution in MySQL 4.1 - you can just store coordinates for the
places and use RTREE indexes to find places in proximity. This is the best solution if you're to have 1.000.000+ objects to deal with.

Options: ReplyQuote


Subject
Views
Written By
Posted
4862
December 13, 2004 11:06AM
Re: Implementing distance matrix 2500 X 2500
3842
December 15, 2004 01:26PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.