4 ms·
I'd probably make user post lists lower on the priority for selects either way. Date range is clearly how you want to partition if you can, as long as you can t
by noduerme 3y ago
I'd probably make user post lists lower on the priority for selects either way. Date range is clearly how you want to partition if you can, as long as you can table up points without hitting the whole damn history for every point change. For something with lots of subs I'd shard by sub / related subs and then partition by date range, subpartition by user id range (probably). That would make user score accretion very slow but most immediate views within a sub or a thread fast. But it would depend on the patterns and seeing what queries took the longest.
Triggers to user_points on some monolith table might be doable.
Also at that point you can run jobs to build user post tables and point scores in a lazy way. Placing immediate post writes and hot thread reads as first priority makes sense if you do have to trade off performance somewhere.