Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a 'People who viewed this also viewed' list

I'm thinking of creating a 'People who viewed this also viewed' list that you see on amazon, yelp and other online sites. Right now I'm thinking of creating a new table with 'product_id', 'last_viewed_product_id', 'hits' where when a user goes from a page for product_id=100 to product_id=101, it will create/update this table with product_id=101, last_viewed_product_id=100, and increment the 'hits' value. Are there better methods that are more optimized and less computationally intensive?

like image 961
Nyxynyxx Avatar asked May 19 '11 23:05

Nyxynyxx


1 Answers

Best I'm aware, the "tricks" used by Amazon to make things less computationally intensive is to a) use bayesian stats/averages and b) compute partial aggregates. The latter allows you to not need to count everything (you can instead sum pre-computed aggregates). The former allows you to inject what you infer will be related material.

like image 64
Denis de Bernardy Avatar answered Sep 21 '22 05:09

Denis de Bernardy