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 7172105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:32:56+00:00 2026-05-28T15:32:56+00:00

Alright, another interesting problem over at Route 50. We wanted to implement a true

  • 0

Alright, another interesting problem over at Route 50.

We wanted to implement a true forum lightbulb system where posts that are unread by a user (after the user’s account is created) show as unread until that status is cleared or until the user reads them.

We figured the best and easiest way to do this would be to implement a table of unread messages.

The Columns are: user_id, board_id, thread_id, post_id, timestamp, and hidden

This is working very well and very quickly for seeing which boards/threads/posts are unread (and linking to them) per user, however it is INCREDIBLY slow for a user to post to the forum even though only a single SQL query is being run:

INSERT IGNORE INTO `forums_lightbulb` SELECT `id`,'x','x','x',UNIX_TIMESTAMP(),0 FROM `users`

I’m sure this is the result of having 3065 user accounts. How can I speed up this process? I’d prefer to keep the system as Real-Time as possible.

Important Note: Please limit your answers to a shared hosting environment with no additional budget. We are limited to PHP and MySQL 5.1.53-log

  • 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-28T15:32:57+00:00Added an answer on May 28, 2026 at 3:32 pm

    What PHPBB does is a very quick way to do it. It keeps a table that marks for each thread and each forum when the last time was a user opened it. And uses that to determine if there are unread messages. It allows a Users*Topics + Users*Forums storage usage scheme while allowing a check with pretty simple and fast queries.

    You can see how it works from the database structure.

    # Table: 'phpbb_forums_track'
    CREATE TABLE phpbb_forums_track (
        user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
        forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
        mark_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
        PRIMARY KEY (user_id, forum_id)
    ) CHARACTER SET `utf8` COLLATE `utf8_bin`;
    
    # Table: 'phpbb_topics_track'
    CREATE TABLE phpbb_topics_track (
        user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
        topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
        forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
        mark_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
        PRIMARY KEY (user_id, topic_id),
        KEY topic_id (topic_id),
        KEY forum_id (forum_id)
    ) CHARACTER SET `utf8` COLLATE `utf8_bin`;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Alright, in my rootViewController, I am able to push another viewController that I defined
Alright, so I've been trying to implement a simple binary search tree that uses
Alright, currently I have my SWF hitting a php file that will go and
Alright, I'm trying to read a comma delimited file and then put that into
Alright. I have a query that looks like this: SELECT SUM(`order_items`.`quantity`) as `count`, `menu_items`.`name`
Alright, so I have a query that looks like this: SELECT `orders`.*, GROUP_CONCAT( CONCAT(
Alright, I'm taking an array, and making another array from it with the only
Alright here's the code: //in another file void **ptr; ptr = kmalloc(sizeof(void *) *
Alright, I'm injecting some code into another process using the CreateRemoteThread/LoadLibrary trick. I end
Alright so here is my issue. I'm working a game engine that will eventually

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.