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?

6
задан Nyxynyxx 19 May 2011 в 23:10
поделиться