mysql> SELECT * FROM stats_mysql_query_digest;
+-----------+--------------------+----------+--------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+------------+------------+----------+----------+----------+
| hostgroup | schemaname | username | digest | digest_text | count_star | first_seen | last_seen | sum_time | min_time | max_time |
+-----------+--------------------+----------+--------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+------------+------------+----------+----------+----------+
| 0 | information_schema | test | 0x13C1B030330ABFAF | SHOW VARIABLES WHERE Variable_name in (?, ?, ?, ?) | 34 | 1467724980 | 1467729356 | 114990 | 2053 | 3801 |
| 1 | information_schema | test | 0x4C4CA35E3C899402 | SELECT (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME=?) `hostname`,(SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME=?) `port` | 43 | 1467873304 | 1467873967 | 102964 | 2118 | 4367 |
| 0 | information_schema | test | 0x29648F83A6DFB03B | SELECT concat(@@hostname,?,@@port) as variable_value for update | 246 | 1467724980 | 1467729356 | 182516 | 290 | 1046 |
| 0 | information_schema | test | 0x8B3EDFFC1D92525A | set session autocommit=? | 34 | 1467724980 | 1467729356 | 21437 | 330 | 726 |
| 0 | information_schema | test | 0x3ABB94868E2C708C | SELECT @@session.auto_increment_increment AS auto_increment_increment, @@character_set_client AS character_set_client, @@character_set_connection AS character_set_connection, @@character_set_results AS character_set_results, @@character_set_server AS character_set_server, @@init_connect AS init_connect, @@interactive_timeout AS interactive_timeout, @@language AS language, @@license AS license, @@lower_case_table_names AS lower_case_table_names, @@max_allowed_packet AS max_allowed_packet, @@net_buffer_length AS net_buffer_length, @@net_write_timeout AS net_write_timeout, @@query_cache_size AS query_cache_size, @@query_cache_type AS query_cache_type, @@sql_mode AS sql_mode, @@system_time_zone AS system_time_zone, @@time_zone AS time_zone, @@tx_isolation AS tx_isolation, @@wait_timeout AS wait_timeout | 1 | 1467725287 | 1467725287 | 2211 | 2211 | 2211 |
| 0 | information_schema | test | 0x226CD90D52A2BA0B | select @@version_comment limit ? | 46 | 1467725241 | 1467873337 | 0 | 0 | 0 |
| 0 | information_schema | test | 0x2B838C3B5DE79958 | SELECT @@session.auto_increment_increment AS auto_increment_increment, @@character_set_client AS character_set_client, @@character_set_connection AS character_set_connection, @@character_set_results AS character_set_results, @@character_set_server AS character_set_server, @@init_connect AS init_connect, @@interactive_timeout AS interactive_timeout, @@license AS license, @@lower_case_table_names AS lower_case_table_names, @@max_allowed_packet AS max_allowed_packet, @@net_buffer_length AS net_buffer_length, @@net_write_timeout AS net_write_timeout, @@query_cache_size AS query_cache_size, @@query_cache_type AS query_cache_type, @@sql_mode AS sql_mode, @@system_time_zone AS system_time_zone, @@time_zone AS time_zone, @@tx_isolation AS tx_isolation, @@wait_timeout AS wait_timeout | 2 | 1467725604 | 1467725686 | 3180 | 958 | 2222 |
| 1 | information_schema | test | 0x2C69F23F00BF749B | SELECT concat(@@hostname,?,@@port) as variable_value | 246 | 1467724980 | 1467729356 | 439477 | 326 | 204978 |
| 1 | information_schema | test | 0xA56346186F5C59DF | SELECT @@hostname,@@port | 60 | 1467725241 | 1467818808 | 122762 | 662 | 5036 |
| 0 | information_schema | test | 0xC51BDBBD6C9BB1D7 | SET autocommit=? | 2 | 1467725604 | 1467725686 | 0 | 0 | 0 |
| 0 | information_schema | test | 0x32DD8987F5DA033D | SET character_set_results = NULL | 2 | 1467725604 | 1467725686 | 1202 | 527 | 675 |
+-----------+--------------------+----------+--------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+------------+------------+----------+----------+----------+
11 rows in set (0.00 sec)
Then I restarted ProxySQL but still same behavior with obviously now only on row in stats_mysql_query_digest:
mysql> SELECT * FROM stats_mysql_query_digest;
+-----------+--------------------+----------+--------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+------------+------------+----------+----------+----------+
| hostgroup | schemaname | username | digest | digest_text | count_star | first_seen | last_seen | sum_time | min_time | max_time |
+-----------+--------------------+----------+--------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+------------+------------+----------+----------+----------+
| 1 | information_schema | test | 0x4C4CA35E3C899402 | SELECT (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME=?) `hostname`,(SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME=?) `port` | 6 | 1467876389 | 1467876394 | 15735 | 2193 | 4341 |
| 0 | information_schema | test | 0x226CD90D52A2BA0B | select @@version_comment limit ? | 1 | 1467876388 | 1467876388 | 0 | 0 | 0 |
+-----------+--------------------+----------+--------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+------------+------------+----------+----------+----------+
2 rows in set (0.00 sec)
Thanks,
Yannick.