What's a good database schema for "Top comments in last 24 hours"
aristus: Um, very. 25 columns?Just record each commentid and vote like so:  create table vote_history (
    commentid  int,
    ts         int
    primary_key (commentid, ts)
  );

Where ts is a unix timestamp. Now you can get rankings for any time slice:select commentid, count(commentid) as points from leaderboard where ts > <TIMESTAMP> group by commentid order by points desc;That gives you to-the-second resolution, which is probably overkill. So instead you can try this:   create table votes_per_hour (
    commentid  int,
    hourid     int,
    score      smallint,
    primary_key (commentid, hourid)
  );

Where the value of hourid is the unix timestamp divided by 3600.