4 ms·
You don't do the calculation on the fly, you do it at data mutation time (if the column should be the same for every client) or in a separate "thread" (eg, a sc
by pbalau 9y ago
You don't do the calculation on the fly, you do it at data mutation time (if the column should be the same for every client) or in a separate "thread" (eg, a script). Basically, you pre calculate the column and simply add it to your table, indexed.
- NicoJuicy 9y agoIt's non deterministic because it has a time variation ( newer posts get ranked higher). Even then?
- erpellan 9y agoDon't modify the scores of old posts, start newer ones with a higher score. Check out how reddit does it: https://medium.com/hacking-and-gonzo/how-reddit-ranking-algorithms-work-ef111e33d0d9 https://medium.com/hacking-and-gonzo/how-reddit-ranking-algo... The concept is that the time-based part of the score is immutable, fixed at post creation time. That way you only have to recalculate when a score-modifying event occurs, not every time the page is refreshed.
- NicoJuicy 9y agoGood advice, thx!