The structure of the database to store the comments?
650 million comments (one table)
Id, text, time, rating, related_img, related_link communication with the user(20 million records), article(140 thousand entries), category(50 entries), the parent comment(650 million)
Reading 50 rps
The opportunity to leave a comment to news ischezaet after 1 month
split into 2 tables? 1 news a month ago, and the rest in archive.
Kyleigh_Hills answered on June 14th 19 at 20:50
Sampling should be in 2 stages (when you consider that all indices are correct!).
1. Select all comments for the current post using only one column Id.
2. Then work only with these comments from the interim sampling (upon receipt of data to output to the page, etc.).
3. You can add cross-connection, if the sample of comments should be not only on the part of the post, but also by a specific user, category, etc.