Review my average rating algorithm

General discussions related to php

Moderators: macek, egami, gesf

Post Reply
johnj
php-forum Super User
php-forum Super User
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: Review my average rating algorithm

Post by johnj » Fri Jul 06, 2012 10:26 pm

The algorithm is calculating the average ONLY when a vote is cast. So, we cannot say that it is faster than sql AVG().

The reason why this cannot be compared with AVG() is there in your writeup...where it says..."...instead the rating can be displayed by just retrieving that single row stored in the 'average_ratings' table...".

johnj
php-forum Super User
php-forum Super User
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: Review my average rating algorithm

Post by johnj » Sat Jul 07, 2012 1:20 am

I am not disputing your attempt and hard work.

But, What you have attempted is already used in many places, like:
(1) In http, http://static.usenix.org/event/osdi02/t ... ode19.html

(2). In Google search

I think even in dns. etc etc

Not only in voting, this idea is used in many places.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests