Im working on a website that is bassed around voting for posts. the website contains a ‘hot’ page will basicly sorts by most votes in the last 24h.
i been thinking about how to set it up table wise for the last few days and im wondering what would be the best option performance wise.
at the moment i was thinking about building a table that makes a new row for every vote and give it the date the vote was made and a id linked to the post and get all the other details like titel and auther from a other table, but sinds the table holding the votes will get really big really fast like this would it be a good idea to remove all the rows that wont get used anymore after 24h hours?
so basicly if its a good idea to make a cronjob that removes all the rows that got made longer then 24hours ago?
It might be a good idea to remove info from the table but remember that SQL works pretty fine with millions of rows!
In your case, I’d run a cronjob every day that removes the rows that got made longer then 48h! I think that this would be enough.