4 ms·
why does it need to be updated in a background process, vs counting how many comments someone has made as well as their total?
by exit 16y ago
why does it need to be updated in a background process, vs counting how many comments someone has made as well as their total?
- blantonl 16y agobecause that can become a rather expensive query when traffic increases on the site. And while the "expectation" is that the number is in real-time, even caching the query might not help much taking into account traffic patterns.
- nerfhammer 16y agoI think that what the parent is saying is that if you can already denormalize your total karma score it can't be much harder to also store the total number of comments and when you want to get average score divide (total karma / total num comments)
- Timothee 16y agoI believe the average karma was more complicated than that. It's something like the average of the last 50 comments, discarding the lowest and highest. So it's a sliding window that the total karma can't reflect as simply.