我在Oracle中有一个记录用户事件的表。该用户可能有很多事件。从这些事件中,我正在计算一个公式的声望。我的问题是,在计算和返回数据时,这是做什么最好的方法。使用视图并使用SQL,通过获取所有事件并计算它(与此相关的问题是当您有用户列表并需要计算所有用户的信誉)或其他内容时,通过代码执行此操作。喜欢听你的想法。声誉公式 - 最佳方法
Comments * (.1) +
Blog Posts * (.3) +
Blog Posts Ratings * (.1) +
Followers * (.1) +
Following * (.1) +
Badges * (.2) +
Connections * (.1)
= 100%
一个例子
Comments:
This parameter is based on the average comments per post.
• Max: 20
• Formula: AVE(#)/max * 100 = 100%
• Example: 5 /10 * 100 = 50%
最大是最大数量得到所有的百分比。希望这是有道理的。
我们正在计算访问,所以所有独特的访问/成员的日期是另一个。该表包含一个事件名称和一些元数据,并与该用户绑定。声誉只是使用这些事件来制定最高100%的声誉。
85% reputation - Joe AuthorUser been a member for 3 years. He has:
• written 18 blog posts
o 2 in the past month
• commented an average of 115 times per month
• 3,000 followers
• following 2,000 people
• received an average like rating of 325 per post
• he's earned, over the past 3 years:
o 100 level 1 badges
o 50 level 2 badges
• he's connected his:
o FB account
o Twitter account
尝试提供更多规范,如数据模型,信誉计算的复杂性... – 2011-03-14 20:15:15
数据量也是 – cagcowboy 2011-03-14 20:19:18
这些信息是否足够? – 2011-03-14 20:40:21