1
我現在使用slope One作爲推薦。如何自動排除推薦算法中已經訪問的項目?
如何從結果中排除訪問的項目?
我不能簡單地通過not in (visited_id_list)
來過濾那些被訪問的數據,因爲它會對舊用戶產生可擴展性問題!
,我想出了一個解決方案,而not in
:
select b.property,count(b.id) total from propertyviews a
left join propertyviews b on b.cookie=a.cookie
left join propertyviews c on c.cookie=0 and b.property=c.property
where a.property=1 and a.cookie!=0 and c.property is null
group by b.property order by total;
你在SQL中實現這個嗎?如果不是,您的數據甚至存儲如何?如果你在處理所有的數據,處理它,然後呈現它......那麼你就會遇到更大的問題。 – pestilence669 2010-01-18 12:39:08
是的,我在MySQL中實現它。 – user198729 2010-01-18 12:43:16