Database Management

Missing statistics for SQL statements when DPA is monitoring a MySQL database instance

DPA is monitoring a MySQL database instance and you don't see statistics for SQL statements.

First published date

10/22/2018 10:39 AM

Last published date

11/7/2025 4:28 PM

Overview

If DPA is monitoring a MySQL database instance and you don't see statistics for SQL statements, use the following information to resolve the issue.

Product section

Database Performance Analyzer

Cause

There are some common reasons for why SQL data can be missing:

  • The MySQL performance schema is disabled.
  • MySQL does not provide statistics for SQL run in a stored procedure.
  • MySQL does not provide statistics for SQL run from a prepared statement.
  • SQL has been executed in batches.

If none of these reasons apply, SolarWinds DPA might not be getting a sufficient quantity of statement history from your MySQL instance to collate SQL statistics. We can extend the amount of statement history available by enabling a MySQL option from within SolarWinds DPA.

Resolution

Verify that the MySQL performance schema is enabled, and that the SQL is not run in a stored procedure, a prepared statement, or batches.

If none of those reasons apply, extend the amount of statement history available, by enabling the MySQL events_statements_history_long table. You can enable this table for all monitored database instances or for just a single database instance.

Enabling events_statements_history_long for all instances 

  1. Log in to the SolarWinds DPA web console as an administrator.
  2. Go to the page Options > Administration > Advanced Options > System Options.
  3. Click one of the following:
    • DPA 2024.4 and later: MYSQL_OR_MARIADB_ENABLE_HISTORY_LONG
    • Earlier versions: MYSQL_ENABLE_HISTORY_LONG
  4. From the New Value list, select Enable.
  5. Click Update.

Enabling events_statements_history_long for a single instance 

  1. Log in to the SolarWinds DPA web console as an administrator.
  2. Go to the page Options > Administration > Advanced Options > DB Instance Options.
  3. Select a database instance from the list.
  4. Click one of the following:
    • DPA 2024.4 and later: MYSQL_OR_MARIADB_ENABLE_HISTORY_LONG
    • Earlier versions: MYSQL_ENABLE_HISTORY_LONG
  5. From the New Value list, select Enable.
  6. Click Update.