MySQL Forums
Forum List  »  Performance

Re: Implementing distance matrix 2500 X 2500
Posted by: Tomas Zvala
Date: December 21, 2004 01:54PM

What exactly does your table contain? Is it as far from a to b as it is from b to a ? If so you need just half the rows. Also you will probably get way less disk io with table designed like that because when select occurs, mysql will have to read just about 3 fields (+some keys) instead of reading 2501 fields (+some keys). Of course you get bigger overhead on the table but i would expect WAY better performance. Also with the 2d table you need indexes on all 2500 fields or mysql will have to read and compare all 2500 values one by one. (there you get overhead too).
If you want to just store the array in mysql you should rather use some function like php's serialize or just binary dump the data into a blob field.

Options: ReplyQuote


Subject
Views
Written By
Posted
4859
December 13, 2004 11:06AM
Re: Implementing distance matrix 2500 X 2500
2291
December 21, 2004 01:54PM


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.