#5063 - Use get_table_count_approx for forum drivers / Do not count bots created by phpBB towards number of members

This is a spacer post for a website comment topic. The content this topic relates to: #5063 - Use get_table_count_approx for forum drivers / Do not count bots created by phpBB towards number of members
From our POV it is inefficient to try and work out what are bots, as those no direct way to do it - we'd have to check group membership, meaning a join and less efficient SQL counting mechanism.

I wonder how phpBB itself handles this. Does it not count bots? Does it show a total at all?

Regardless, this isn't a big issue, we just wanted to raise it on the tracker in case people care and to have the discussion.
It is possible to get the member count with 2 queries: first, grab the bot group ID, second, run a COUNT on the users table for all users whose primary group does not match that bot group ID (primary group is on the users table, so no JOIN is needed)

Is this going to be reliable or does it hard-code a group name that might be edited / vary by language?

Also in the ideal world we'd be using get_table_count_approx for the member/topic/post count queries in the forum drivers, as counting full table rows on InnoDB is very slow. We're currently only doing that for CNS. If we do that, we either need to not do the filtering or actually have a third query for the number of bots to subtract (rather than doing it as part of a WHERE clause). I'll add that to this issue.
It looks like it would be reliable; the group name is BOTS and cannot be edited in the phpBB interface. I ran a Spanish install and it was still BOTS in the database (the other group names were also the same).
0 guests and 0 members have recently viewed this.