Chapter 3 Using the Query Analyzer

Table of Contents

3.1 Providing Query Analyzer Data
3.1.1 Using the MySQL Enterprise Plugin for Connector/J
3.1.2 Using the MySQL Enterprise Plugin for Connector/PHP
3.1.3 Using the MySQL Enterprise Plugin for Connector/Net
3.1.4 Using the MySQL Enterprise Agent Aggregator
3.1.5 Using the Agent Proxy
3.2 Query Analyzer User Interface
3.2.1 Getting Detailed Query Information
3.2.2 Using Graphs to Identify Queries
3.2.3 Query Analyzer Settings
3.2.4 Filtering Query Analyzer Data
3.2.5 Exporting Query Information
3.3 Troubleshooting Query Analyzer

The MySQL Query Analyzer lets you monitor SQL statements executed on a MySQL server and see details about each query, as well as number of executions and execution times. Similar queries with different literal values are combined (normalized) for reporting purposes.

Query Analyzer collects information about SQL statements that a MySQL client application sends to the MySQL server. The client application must either route its database requests through the MySQL Enterprise Monitor Agent proxy service, or use the MySQL Enterprise Monitor Plugin for a given Connector that sends the information directly to MySQL Enterprise Service Manager. Once your MySQL client application is configured to communicate via the MySQL Enterprise Monitor Agent, queries are monitored and the normalized queries are sent to the MySQL Enterprise Monitor Agent.

For the different ways to enable Query Analysis, see Section 3.1, “Providing Query Analyzer Data” For the user interface of the Query Analyzer, see Section 2.6, “The Query Analyzer Tab” and Section 3.2, “Query Analyzer User Interface”.


The MySQL Proxy component and Query Analyzer require that clients connecting through MySQL Enterprise Monitor Agent use MySQL 5.0 or later. Clients that use the libmysqlclient library provided with MySQL 4.1 or earlier do not work with MySQL Enterprise Monitor Agent.

Once the data is collected, you view and monitor the queries, check the execution statistics, and filter and drill down on the information. By comparing the queries to the server graphs, you can correlate query execution with server status. For more information on viewing, filtering and reporting on the Query Analyzer data, see Section 3.2, “Query Analyzer User Interface”.


When MySQL Enterprise Monitor is not accessible from a Connector/J or Connector/NET query analyzer plugin, then the application performance will not be impacted. Over time, the plugin will determine that a backlog of reportable data exists, and fall back to consolidating it over longer ranges of time. But if more than 1,000 canonical queries are being used by the application (an unlikely scenario), then data will begin to be dropped.


MySQL Enterprise subscription, MySQL Enterprise Monitor, MySQL Replication Monitor, and MySQL Query Analyzer are only available to commercial customers. To learn more, see: