
Slow Queries
- Moodle 1.9–5.1
- 中文 61%
- 更新 2026-11-01
An admin-only plugin that turns your mdl_log_queries table into a practical UI to find, triage, and analyze slow SQL statements executed by Moodle.
local_slow_queries is an admin-only plugin that turns your mdl_log_queries table into a practical UI to find, triage and analyze slow SQL statements executed by Moodle.
It focuses on three daily workflows:
List & filter slow queries quickly (default exectime > 3s ).
Open details with SQL + parameters and a ready-to-use ChatGPT prompt including table schemas.
Use dashboards to see patterns: top slowest, recurrence, distribution, CRON vs WEB, by qtype, and errors.
Access is restricted to: require_capability(“moodle/site:config”, context_system::instance())
Data source
The plugin reads from:
Table: mdl_log_queries
Fields used by the UI:
id — unique identifier
qtype — query type (stored by your logger)
sqltext — SQL statement text
sqlparams — parameters (string representation)
error — non-zero marks error
info — optional extra data
backtrace — string backtrace
exectime — decimal seconds
timelogged — unix timestamp
- 1.1.14Moodle 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 5.0, 5.1, 5.2, 5.3
- 1.1.5Moodle 1.9