3 ms·
Since individual comment threads are never that big, just store the root parent ID and query on that. Then reconstruct in code.
by MichaelGG 11y ago
Since individual comment threads are never that big, just store the root parent ID and query on that. Then reconstruct in code.
- Kenji 11y agoYeah that's how I currently implemented it on my site, but it can't harm to overthink the solution of performance problems I don't (yet?) have ;)
- krapp 11y agoYou could probably solve more nonexistent problems with caching than by limiting thread depth.
- deleted 11y ago[deleted]
- krapp 11y agoTo clarify - more users are going to read and refresh pages than actually post, so making certain not every GET request results in a new database query would probably improve performance more than trying to limit the number of rows in each query. Query performance obviously matters, but with a HN like site, it's probably not going to be so critical that limiting the depth of threads is even worth the effort.