スロークエリログ
SafeSlow query logging
SET GLOBAL slow_query_log = ON;
Records queries over a threshold — set long_query_time around 1 s and gather evidence before tuning.
Examples
SHOW VARIABLES LIKE 'slow_query%';Logging state and file path
Syntax
SET GLOBAL slow_query_log=ON; SET GLOBAL long_query_time=1; / SHOW VARIABLES LIKE 'slow%';
Before you run it
Logging only; adds some I/O.
Related commands
- EXPLAINQuery plan
- Show running queriesShow running queries
The same reference, with no signal at all
Every command on this site, held on your device. The app adds 632 more: 1,510 commands and 120 fix flows, searchable with no connection. Free to install, no ads (some content is a one-time purchase).
Get it free on the App Store