Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
03-21-2010, 03:57 AM #1
Efficient ways to make Rating scripts?
So this has been bobbled up in my head for quite some time: What other ways are there to create an efficient rating script?
So here are the only ways I've thought of, visavi MySQL:
1) Constantly summing the ratings and dividing it by the total amount of ratings available in a table. This is, in my opinion, the slowest way to do things.
2) Have two fields in a table called ratingSum and totalRaters, where you can just do ratingSum/totalRaters. This is the faster way, but I think that it isn't as "nice"
What would be more efficient than #2?
03-21-2010, 04:39 AM #2
- Join Date
- Jun 2003
- Cottage Grove, Minnesota
- Thanked 1,162 Times in 1,153 Posts
It depends on what you're rating.
I think #2 is the best way for something like books, or videos ...
Say you have a database full of books. Each row is one book.
If people were rating the books, it would be easiest to add the user's
rating to one field (sum), and then increment another field (qty - how many votes).
Now if you're comparing ratings between a whole table of items, instead of
rating each item separately, that might change things.
So, I guess you would have to analyze each situation differently, and you didn't
specify exacty what you're rating ... so I guess we'll never know.