Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4004362
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T08:15:51+00:00 2026-05-20T08:15:51+00:00

I am looking for a optimal way to store info about which users already

  • 0

I am looking for a optimal way to store info about which users already read what posts on simple forum engine I am building, so I can mark new posts for them. I am looking for both space- and performance- optimized way.

The first that comes to mind is the pure way of creating table with post_id and user_id columns in which each row would represent read post by a user. But this leads to a lot of data inserted and performance stress on the database. And even more of data inserted after clicking on “mark all as read”. If all users would have read all posts, this would mean (users count) * (posts count) rows in the database.

This method could be optimized to store timestamp for each thread and each user and update these timestamps each time user reads new posts. But it’s still a lot of data.This would mean (users count) * (thread count) rows.

I can simplify this to storing “last visited” timestamp on the forum (i.e. thread category) level. This would mean (users count) * (forum count), which is not that bad, but there is a question when should I update this timestamp, so it’s not too much confusing for users.

Thanks for any ideas.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T08:15:51+00:00Added an answer on May 20, 2026 at 8:15 am

    I suppose “each thread has n posts” is how you use those terms.

    I think the best would be to store each (user_id, read thread_id, timestamp). I understand you realize it is not (users count) * (thread count) rows, it is (users count) * (read threads count) rows.

    If a user marks all as read insert a special value as thread_id like 0.

    As Dagon pointed a good open source forum would have already solved all the problems.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am looking for advice as to the most optimal way to store and
This is probably something very simple but I'm looking for the optimal way of
I am looking to see if there is a smart or optimal way to
I am looking for the optimal (fastest) way to find the exact overlap between
I'm looking for an optimal design for the following usecase. I'm building a system
I'm looking for a way to store a serialized value of eg. IDs in
I'm looking for the optimal way to create a function that can accept no
Looking for a way to get path of file (and then process it in
Looking for a simple bit of JS to count the number of items in
I'm looking for the best way to search a string of alphabetical characters for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.