MySQL HeatWave User Guide

5.10.3 Scanned Data Monitoring

MySQL HeatWave tracks the amount of base relation data scanned by all queries collectively and by individual queries. Base relation data depends on the table schema, number of rows in each table, and DML operations on a MySQL table. Features like Auto Zonemap and MySQL table partitions also impact the base relation data scanned by a query. When one of these features is present, the actual bytes scanned are typically lower than a full base relation scan. The data scanned is calculated in megabytes (MB) based on the in-memory allocation.

To view a cumulative total of data scanned (in MB) by all successfully executed MySQL HeatWave queries from the time the MySQL HeatWave Cluster was last started, query the hw_data_scanned global status variable. For example:

mysql> SHOW GLOBAL STATUS LIKE 'hw_data_scanned';
+-----------------+-------+
| Variable_name   | Value |
+-----------------+-------+
| hw_data_scanned | 66    |
+-----------------+-------+

The cumulative total does not include data scanned by failed queries, queries that were not offloaded to MySQL HeatWave, or EXPLAIN queries.

The hw_data_scanned value is reset to 0 only when the MySQL HeatWave Cluster is restarted.

If a subset of MySQL HeatWave nodes go offline, MySQL HeatWave retains the cumulative total of scanned data as long as the MySQL HeatWave Cluster remains in an active state. When the MySQL HeatWave Cluster becomes fully operational and starts processing queries again, MySQL HeatWave resumes tracking the amount of data scanned, adding to the cumulative total.

mysql> SELECT query_id,
          JSON_EXTRACT(JSON_UNQUOTE(qexec_text->'$**.error'),'$[0]') AS error_message
          FROM performance_schema.rpd_query_stats;
+----------+------------+--------------+---------------+
| query_id | session_id | data_scanned | error_message |
+----------+------------+--------------+---------------+
|        1 | 8          | 66           | ""            |
+----------+------------+--------------+---------------+

The example above retrieves any error message associated with the query ID. If a query fails or was interrupted, the number of bytes scanned by the failed or interrupted query and the associated error message are returned, as shown in the following examples:

mysql> SELECT query_id,
          JSON_EXTRACT(JSON_UNQUOTE(qexec_text->'$**.error'),'$[0]') AS error_message
          FROM performance_schema.rpd_query_stats;
+----------+------------+--------------+------------------------------------------+
| query_id | session_id | data_scanned | error_message                            |
+----------+------------+--------------+------------------------------------------+
|        1 | 8          | 461          | "Operation was interrupted by the user." |
+----------+------------+--------------+------------------------------------------+
mysql> SELECT query_id,
          JSON_EXTRACT(JSON_UNQUOTE(qexec_text->'$**.error'),'$[0]') AS error_message
          FROM performance_schema.rpd_query_stats;
+----------+------------+--------------+-----------------------------------------------+
| query_id | session_id | data_scanned | error_message                                 |
+----------+------------+--------------+-----------------------------------------------+
|        1 | 8          | 987          | "Out of memory error during query execution in|
|          |            |              |  RAPID."                                      |
+----------+------------+--------------+-----------------------------------------------+