- Joined
- Jul 25, 2024
- Messages
- 142
- Thread Author
- #1
This is a query which updates user post counts. It takes into consideration moderated and deleted status of threads and posts, as well as each forum's "Count messages posted in this forum toward user total" setting.
The above single query may timeout on very large forums. If this is the case, you can break it down into queries that handle a smaller number of users in each query.
The example below would handle it in three chunks of up to 50,000 users with each query. Change it as needed for your forum and keep running it with additional queries, each with higher counts in the two user.user_id WHERE clauses until no more records are matched:
The above single query may timeout on very large forums. If this is the case, you can break it down into queries that handle a smaller number of users in each query.
The example below would handle it in three chunks of up to 50,000 users with each query. Change it as needed for your forum and keep running it with additional queries, each with higher counts in the two user.user_id WHERE clauses until no more records are matched: