Celko nested sets would be most efficient and maintain the ability to infinitely nest records. The only cost is recalculation on the upsert...
If I were to do this, I'd have a key for the thread ID the post goes with and then have a left/right val for each thread:
https://en.wikipedia.org/wiki/Nested_set_model
You should also probably consider whatever model is in place for the voats/karma/comment relationships as that data may be stored discretely to avoid cheating as much as possible since everyone only counts one vote per item.
0
24 Jun 2017 14:58
u/greyhat399321
in v/programming
Celko nested sets would be most efficient and maintain the ability to infinitely nest records. The only cost is recalculation on the upsert...
If I were to do this, I'd have a key for the thread ID the post goes with and then have a left/right val for each thread:
https://en.wikipedia.org/wiki/Nested_set_model
You should also probably consider whatever model is in place for the voats/karma/comment relationships as that data may be stored discretely to avoid cheating as much as possible since everyone only counts one vote per item.