MyBB Community Forums

Full Version: MySQL Command running 200+ times
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
On ym index page i'm currently getting 225 queries running, but not on any other page of the forums. When clicking the advanced stats i can see this query is running about 200 times, can anyone tell me what its doing?

SELECT uid FROM mybb_sessions WHERE time>'1172397567' AND location1=''

sometimes the location is populated with a number.

Plugin List

Active users
Advanced Stats on Index
Autoset BBurl
Autoset Cookie paths
Count forum viewers
country flag
downloads section
email notification on registration
hide links to guests
one signature per page
show online users today
posts required to view forum
quick theme
spisefuse shoutbox
thread descriptions
thank you
unread PM notification
This query retrieve all the sessions from the database. I don't think it is doing anything wrong assuming you have 200 sessions in the db.


Please don't double post.
Merged into one post to keep Zaher happy Toungue


I disabled the Count Viewers Plugin and the queries lowered to 47, does this plugin require a query for each forum?
zaher1988 Wrote:This query retrieve all the sessions from the database. I don't think it is doing anything wrong assuming you have 200 sessions in the db.


Please don't double post.

Yes it is. Something is wrong then as it should never run 200 queries when there is 200 sessions in the database. It selects all in one go. Not by default anyways has to be a plug-in then.
Indeed.... you are right actually, i mixed up between 200 loops of a fetched query, and 200 seperate queriesToungue


Sye Wrote:Merged into one post to keep Zaher happy Toungue


I disabled the Count Viewers Plugin and the queries lowered to 47, does this plugin require a query for each forum?

The plugin checks the session of every loaded forum while it is being loaded, that explains why ...
I might need to recode a less quries version in the coming future.