Hi Everybody,
I'm working on an application to compare the associations of items in several lists. Probably the most well known example is how on facebook they offer a friend suggestion based on quantity of friends in common.
A while back I developed a similar application to display keywords that were most frequently associated with the selected keyword. However, looking over the many to many table that I'd created it sort of rubs me wrong that the same association has two records...so the table has twice as many records as is necessary. Meaning, there is a record that associates Item A with Item B and a record that associates Item B with Item A. However, the alternative requires making more requests on the server...because when you're adding a new association you have to check for both possibilities...if your first query doesn't yield a result.
Generally, I prefer to sacrifice space rather than speed. For example, in the many to many table I also have a column that contains a count of how many times that association has been made...instead of trying to calculate that on the fly.
Anybody ever work on anything similar and come up with a more efficient solution?
Thanks in advance!
I'm working on an application to compare the associations of items in several lists. Probably the most well known example is how on facebook they offer a friend suggestion based on quantity of friends in common.
A while back I developed a similar application to display keywords that were most frequently associated with the selected keyword. However, looking over the many to many table that I'd created it sort of rubs me wrong that the same association has two records...so the table has twice as many records as is necessary. Meaning, there is a record that associates Item A with Item B and a record that associates Item B with Item A. However, the alternative requires making more requests on the server...because when you're adding a new association you have to check for both possibilities...if your first query doesn't yield a result.
Generally, I prefer to sacrifice space rather than speed. For example, in the many to many table I also have a column that contains a count of how many times that association has been made...instead of trying to calculate that on the fly.
Anybody ever work on anything similar and come up with a more efficient solution?
Thanks in advance!