In the first part of this article related to the check plugin, we discovered information retrieved from the binary logs. This part, is about what Performance_Schema
and SYS
can provide us about the queries hitting the MySQL database.
Currently, 3 methods are available:
getSlowerQuery()
getQueryTempDisk()
getFullTableScanQuery()
The method’s name should be self explaining.
This is an overview of the parameters for each methods:



Some methods allow a select
parameter if only SELECT
statements should be returned.
When only one query is returned (default), it’s also possible to interactively run several actions:
- EXPLAIN (Traditional MySQL Query Execution Plan)
- EXPLAIN FORMAT=JSON
- EXPLAIN FORMAT=TREE
- EXPLAIN ANALYZE
This is a video illustrating these operations:
Don’t hesitate to try those plugins and a report eventual bugs, enhancements, feature requests and your own plugins !
The github repository is https://github.com/lefred/mysqlshell-plugins