I searched for popularity algorithms used on sites like Reddit , Digg and even Stackoverflow .
Reddit Algorithm:
t = (time of entry post) - (Dec 8, 2005) x = upvotes - downvotes y = {1 if x > 0, 0 if x = 0, -1 if x < 0) z = {1 if x < 0, otherwise x} log(z) + (y * t)/45000
I have always done simple ordering in SQL, I wonder how I should deal with such ordering.
Should it be used to define a table or can I build SQL with ordering in a formula (without any difficulty)?
I also wonder if in different cases you can use several sequencing algorithms without affecting performance issues.
I am using Django and PostgreSQL.
Help would be greatly appreciated! ^^
sql django postgresql django-orm popularity
Radianthex
source share