[docs] add system.query_log
@@ -28,7 +28,6 @@ mysql> SELECT avg(number) FROM numbers(100000000);
The same as system.numbers
-
## system.settings
Contains information about session settings for current user.
@@ -133,3 +132,18 @@ mysql> SELECT * FROM system.credits LIMIT 20;
+-------------------+---------+---------------------------+
20 rows in set (1.33 sec)
```
+
+## system.query_log
+
+A read-only in-memory table stores all the query logs;
+
+```sql
+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 | | | | |
++----------+--------------+-----------+--------------+----------+-----------------------------+---------------------------------------------------------------------------+--------------------------------------+------------+------------+------------+-------------------------+------------------+-----------+--------+---------+-------------+--------------+---------------+-----------+------------+-------------+--------------+-----------+--------------+-------------+-----------------------+----------------+----------------+-------------+----------------+-------+
+1 row in set (0.05 sec)
+Read 2 rows, 1.21 KB in 0.042 sec., 47.27 rows/sec., 28.51 KB/sec.
+```
