-
To view the number of queries offloaded to the MySQL HeatWave Cluster for execution since the last time MySQL HeatWave Cluster was started:
mysql> SELECT VARIABLE_VALUE FROM performance_schema.global_status WHERE VARIABLE_NAME = 'rapid_query_offload_count'; +----------------+ | VARIABLE_VALUE | +----------------+ | 62 | +----------------+ -
The Performance Schema statement event tables (see Performance Schema Statement Event Tables), and the
performance_schema.threadsandperformance_schema.processlisttables include anEXECUTION_ENGINEcolumn that indicates whether a query was processed on thePRIMARYorSECONDARYengine, where the primary engine is InnoDB and the secondary engine is MySQL HeatWave. Thesys.processlistandsys.x$processlistviews in the MySQLsysSchema also include anexecution_enginecolumn.This query shows the schema, the first 50 characters of the query, and the execution engine that processed the query:
mysql> SELECT CURRENT_SCHEMA, LEFT(DIGEST_TEXT, 50), EXECUTION_ENGINE FROM performance_schema.events_statements_history WHERE CURRENT_SCHEMA='tpch'; +----------------+----------------------------------------------------+------------------+ | CURRENT_SCHEMA | LEFT(DIGEST_TEXT, 50) | EXECUTION_ENGINE | +----------------+----------------------------------------------------+------------------+ | tpch | SELECT COUNT(*) FROM tpch.LINEITEM | SECONDARY | +----------------+----------------------------------------------------+------------------+ -
The Performance Schema statement summary tables (see Statement Summary Tables) include a
COUNT_SECONDARYcolumn that indicates the number of times a query was processed on theSECONDARYengine (MySQL HeatWave).This query retrieves the total number of secondary engine execution events from the
events_statements_summary_by_digesttable:mysql> SELECT SUM(COUNT_SECONDARY) FROM performance_schema.events_statements_summary_by_digest; +----------------------+ | SUM(COUNT_SECONDARY) | +----------------------+ | 25 | +----------------------+This query counts all engine execution events for a particular schema and shows how many occurred on the primary engine (InnoDB) and how many occurred on the secondary engine (MySQL HeatWave):
mysql> SELECT SUM(COUNT_STAR) AS TOTAL_EXECUTIONS, SUM(COUNT_STAR) - SUM(COUNT_SECONDARY) AS PRIMARY_ENGINE, SUM(COUNT_SECONDARY) AS SECONDARY_ENGINE FROM performance_schema.events_statements_summary_by_digest WHERE SCHEMA_NAME LIKE 'tpch'; *************************** 1. row *************************** TOTAL_EXECUTIONS: 25 PRIMARY_ENGINE: 5 SECONDARY_ENGINE: 20