In case you have your own slow SQL query, you can optimize it automatically here.
For the query above, the following recommendations will be helpful as part of the SQL tuning process.
You'll find 3 sections below:
SELECT
information_schema_processlist_id,
information_schema_processlist_time,
information_schema_processlist_user,
information_schema_processlist_host,
information_schema_processlist_db,
information_schema_processlist_command,
information_schema_processlist_state,
information_schema_processlist_info
FROM
((SELECT
INFORMATION_SCHEMA.PROCESSLIST.ID AS information_schema_processlist_id,
INFORMATION_SCHEMA.PROCESSLIST.TIME AS information_schema_processlist_time,
INFORMATION_SCHEMA.PROCESSLIST.USER AS information_schema_processlist_user,
INFORMATION_SCHEMA.PROCESSLIST.HOST AS information_schema_processlist_host,
INFORMATION_SCHEMA.PROCESSLIST.DB AS information_schema_processlist_db,
INFORMATION_SCHEMA.PROCESSLIST.COMMAND AS information_schema_processlist_command,
INFORMATION_SCHEMA.PROCESSLIST.STATE AS information_schema_processlist_state,
INFORMATION_SCHEMA.PROCESSLIST.INFO AS information_schema_processlist_info
FROM
INFORMATION_SCHEMA.PROCESSLIST
WHERE
INFORMATION_SCHEMA.PROCESSLIST.DB IS NOT NULL
AND (
INFORMATION_SCHEMA.PROCESSLIST.INFO IS NULL
)
AND INFORMATION_SCHEMA.PROCESSLIST.TIME > (
SELECT
information_schema.PROCESSLIST.TIME
FROM
information_schema.PROCESSLIST
WHERE
information_schema.PROCESSLIST.id = 1319084
)
ORDER BY
INFORMATION_SCHEMA.PROCESSLIST.`TIME`)
UNION
DISTINCT (SELECT
INFORMATION_SCHEMA.PROCESSLIST.ID AS information_schema_processlist_id,
INFORMATION_SCHEMA.PROCESSLIST.TIME AS information_schema_processlist_time,
INFORMATION_SCHEMA.PROCESSLIST.USER AS information_schema_processlist_user,
INFORMATION_SCHEMA.PROCESSLIST.HOST AS information_schema_processlist_host,
INFORMATION_SCHEMA.PROCESSLIST.DB AS information_schema_processlist_db,
INFORMATION_SCHEMA.PROCESSLIST.COMMAND AS information_schema_processlist_command,
INFORMATION_SCHEMA.PROCESSLIST.STATE AS information_schema_processlist_state,
INFORMATION_SCHEMA.PROCESSLIST.INFO AS information_schema_processlist_info
FROM
INFORMATION_SCHEMA.PROCESSLIST
WHERE
INFORMATION_SCHEMA.PROCESSLIST.DB IS NOT NULL
AND (INFORMATION_SCHEMA.PROCESSLIST.`INFO` NOT LIKE '%INFORMATION_SCHEMA%')
AND INFORMATION_SCHEMA.PROCESSLIST.TIME > (SELECT
information_schema.PROCESSLIST.TIME
FROM
information_schema.PROCESSLIST
WHERE
information_schema.PROCESSLIST.id = 1319084)
ORDER BY
INFORMATION_SCHEMA.PROCESSLIST.`TIME`)
) AS union1
ORDER BY
union1.information_schema_processlist_time