Skip to main content

system.query_log

A read-only in-memory table stores all the query logs;

mysql> SELECT * FROM system.query_log LIMIT 1;
+----------+--------------+-----------+--------------+----------+-----------------------------+---------------------------------------------------------------------------+--------------------------------------+------------+------------+------------+-------------------------+------------------+-----------+--------+---------+-------------+--------------+---------------+-----------+------------+-------------+--------------+-----------+--------------+-------------+-----------------------+----------------+----------------+-------------+----------------+-------+
| log_type | handler_type | tenant_id | cluster_id | sql_user | sql_user_quota | sql_user_privileges | query_id | query_kind | query_text | event_date | event_time | current_database | databases | tables | columns | projections | written_rows | written_bytes | read_rows | read_bytes | result_rows | result_bytes | cpu_usage | memory_usage | client_info | client_address | exception_code | exception_text | stack_trace | server_version | extra |
+----------+--------------+-----------+--------------+----------+-----------------------------+---------------------------------------------------------------------------+--------------------------------------+------------+------------+------------+-------------------------+------------------+-----------+--------+---------+-------------+--------------+---------------+-----------+------------+-------------+--------------+-----------+--------------+-------------+-----------------------+----------------+----------------+-------------+----------------+-------+
| 1 | MySQL | | test_cluster | default | UserGrantSet { grants: [] } | UserQuota { max_cpu: 0, max_memory_in_bytes: 0, max_storage_in_bytes: 0 } | 83b25875-2722-4439-8944-ffbf7d4462f4 | SelectPlan | SELECT 1 | 2021-12-23 | 2021-12-23 17:55:47.569 | default | | | | | 0 | 0 | 0 | 0 | 0 | 0 | 16 | 3527 | | Some(127.0.0.1:42074) | 0 | | | | |
+----------+--------------+-----------+--------------+----------+-----------------------------+---------------------------------------------------------------------------+--------------------------------------+------------+------------+------------+-------------------------+------------------+-----------+--------+---------+-------------+--------------+---------------+-----------+------------+-------------+--------------+-----------+--------------+-------------+-----------------------+----------------+----------------+-------------+----------------+-------+