PDA

View Full Version : How Post Count is Calculated


tsptom
08-18-2014, 05:22 PM
I have a question about how post counts are determined. I have one member who has 5042 posts, according to the database using this query:

SELECT count(*)
FROM post
WHERE username = 'xxx'

But that gets 42 more rows than what the post count in the forum is, which says 5000 even.

The "visible" field has 5039 1's and 3 2's, if that means anything.

What would cause the difference?

Thanks.

Lynne
08-18-2014, 05:57 PM
Do any of your forums have "Count Posts Made in this Forum Towards User Post Counts" set to No?

tsptom
08-18-2014, 06:14 PM
Interesting. Is there a way to check that in the database, as opposed to checking the individual forum settings?

--------------- Added 1408389824 at 1408389824 ---------------

I'm not seeing any of the obvious forums set that way, like private forums and threads.

Could it have anything to do with deleted forums or threads? How about soft deleted posts?

ozzy47
08-18-2014, 06:27 PM
Its possible it could be due to soft deleted posts, or posts that are in moderation.

tsptom
08-18-2014, 06:33 PM
Thanks. Do you know how to eliminate soft deleted posts from this select statement?

SELECT count(*)
FROM post
WHERE username = 'xxx'

ozzy47
08-18-2014, 06:44 PM
Try this:
SELECT count(*)
FROM post
WHERE username = 'xxx' AND visible = 1

tsptom
08-18-2014, 07:05 PM
Adding visible took it down to the 5039. (there were three 2's in the visible column).

I think I will just have to go with the "posts" column in the user table. It matches the current forum's post count, but not what I count using the select. I was just curious why they didn't match.

Thank you!