MyBB Community Forums

Full Version: Slow Query Log
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
A way to log queries that take longer than x seconds  to execute should be logged so an administrator can see that there might be a problem. ( Probably default of 2 seconds )  My database_helper plugin does this and code could certainly be taken from it and applied to the database classes.  The log would then be viewable in the Admin CP under Tools & Maintenance.
Log all queries.

A slowdown momentarily or something even more sinister can then be tracked.
For users using a VPS or dedicated server, this can be done at the DBMS level with MySQL's slow query log.

If it were to be implemented in MyBB, it wouldn't make sense to log slow queries to the DB and they should instead be written to a log file.