From edd3aeb706329f3bdc79c15b1f7eb5d9e7adfdf1 Mon Sep 17 00:00:00 2001 From: Michael Coburn Date: Mon, 6 Jul 2026 13:13:46 -0600 Subject: [PATCH] Clarify QAN data sources and prepared-statement visibility for MySQL Query Analytics reads only from a file-based slow query log or Performance Schema (not the general log or log_output=TABLE). With the Performance Schema source, server-side prepared statements show placeholder examples and no EXPLAIN, because of how upstream MySQL exposes them; the file-based slow query log has real values. Signed-off-by: Michael Coburn --- .../connect-database/mysql/mysql.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/documentation/docs/install-pmm/install-pmm-client/connect-database/mysql/mysql.md b/documentation/docs/install-pmm/install-pmm-client/connect-database/mysql/mysql.md index 1749796ecdf..ecee3199285 100644 --- a/documentation/docs/install-pmm/install-pmm-client/connect-database/mysql/mysql.md +++ b/documentation/docs/install-pmm/install-pmm-client/connect-database/mysql/mysql.md @@ -119,6 +119,20 @@ While you can use both at the same time we recommend using only one--there is so The choice depends on the version and variant of your MySQL instance, and how much detail you want to see. +!!! note "Query Analytics data sources and prepared statements" + + Query Analytics (QAN) reads queries only from the slow query log written to a + file (`log_output=FILE`) or from Performance Schema. It cannot read the general + query log or a slow query log written to a table (`log_output=TABLE`). + + If your application uses server-side prepared statements (common with drivers + such as JDBC), expect partial data on the Performance Schema source: query + examples appear as placeholders (`?`) instead of literal values, and EXPLAIN is + unavailable for them. This is how upstream MySQL exposes prepared statements to + Performance Schema, not a PMM limitation. The file-based slow query log records + executed statements with their real values, so examples and EXPLAIN are fuller + there. + #### Data source comparison Here are the benefits and drawbacks of Slow query log and Performance Schema metrics sources: