Skip to content

Commit 219aa72

Browse files
authored
fix: i18n (#1649)
1 parent 52e9bb7 commit 219aa72

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

docs/cn/sql-reference/00-sql-reference/20-system-tables/system-query-log.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,37 @@
22
title: system.query_log
33
---
44

5+
import FunctionDescription from '@site/src/components/FunctionDescription';
6+
7+
<FunctionDescription description="Introduced or updated: v1.2.696"/>
8+
59
一个只读的内存表,用于存储所有查询日志。
610

11+
## 设置会话标签
12+
13+
您可以选择为会话分配一个标记,从而更容易根据分配的会话标记过滤日志表中的日志。例如,下面的代码将标签“eric”分配给当前会话:
14+
15+
```sql
16+
set session query_tag='eric';
17+
18+
```
19+
20+
然后,我们可以运行一个查询,并使用指定的标签从日志表中检索日志:
21+
22+
```sql
23+
show users;
24+
25+
select query_tag, query_text from system.query_log where query_tag='eric' limit 1;
26+
27+
```
28+
29+
在返回的结果中,您可以找到标记为“eric”的查询记录:
30+
31+
```sql
32+
-[ RECORD 1 ]-----------------------------------
33+
query_tag: eric
34+
query_text: SHOW USERS
35+
```
736

837
## 示例
938

@@ -20,6 +49,7 @@ SELECT * FROM system.query_log LIMIT 1;
2049
sql_user: root
2150
sql_user_quota: UserQuota<cpu:0,mem:0,store:0>
2251
sql_user_privileges: GRANT ALL ON *.*, ROLES: ["account_admin"]
52+
query_tag:
2353
query_id: 7e03cd7a-36fa-463d-afe4-041da4092c45
2454
query_kind: Other
2555
query_text: SHOW TABLES
@@ -68,4 +98,4 @@ written_io_bytes_cost_ms: 0
6898
session_settings: acquire_lock_timeout=30, aggregate_spilling_bytes_threshold_per_proc=0, aggregate_spilling_memory_ratio=60, auto_compaction_imperfect_blocks_threshold=25, collation=utf8, compact_max_block_selection=10000, cost_factor_aggregate_per_row=5, cost_factor_hash_table_per_row=10, cost_factor_network_per_row=50, create_query_flight_client_with_current_rt=1, data_retention_time_in_days=1, ddl_column_type_nullable=1, disable_join_reorder=0, disable_merge_into_join_reorder=0, disable_variant_check=0, efficiently_memory_group_by=0, enable_aggregating_index_scan=1, enable_auto_fix_missing_bloom_index=0, enable_bloom_runtime_filter=1, enable_cbo=1, enable_clickhouse_handler=0, enable_compact_after_write=1, enable_distributed_compact=0, enable_distributed_copy_into=1, enable_distributed_merge_into=1, enable_distributed_recluster=0, enable_distributed_replace_into=0, enable_dphyp=1, enable_dst_hour_fix=0, enable_experimental_aggregate_hashtable=1, enable_experimental_merge_into=1, enable_experimental_queries_executor=0, enable_experimental_rbac_check=1, enable_geo_create_table=0, enable_hive_parquet_predict_pushdown=1, enable_loser_tree_merge_sort=0, enable_merge_into_row_fetch=1, enable_new_copy_for_text_formats=1, enable_parquet_page_index=1, enable_parquet_prewhere=0, enable_parquet_rowgroup_pruning=1, enable_query_result_cache=0, enable_refresh_aggregating_index_after_write=1, enable_refresh_virtual_column_after_write=1, enable_replace_into_partitioning=1, enable_strict_datetime_parser=1, enable_table_lock=1, enforce_broadcast_join=0, external_server_connect_timeout_secs=10, external_server_request_batch_rows=65536, external_server_request_timeout_secs=180, flight_client_timeout=60, format_null_as_str=1, geometry_output_format=GeoJSON, group_by_shuffle_mode=before_merge, group_by_two_level_threshold=20000, hide_options_in_show_create_table=1, hive_parquet_chunk_size=16384, http_handler_result_timeout_secs=60, idle_transaction_timeout_secs=14400, inlist_to_join_threshold=1024, input_read_buffer_size=4194304, join_spilling_buffer_threshold_per_proc_mb=1024, join_spilling_bytes_threshold_per_proc=0, join_spilling_memory_ratio=60, join_spilling_partition_bits=4, lazy_read_threshold=1000, load_file_metadata_expire_hours=24, max_block_size=65536, max_cte_recursive_depth=1000, max_execute_time_in_seconds=0, max_inlist_to_or=3, max_memory_usage=6577507532, max_result_rows=0, max_set_operator_count=18446744073709551615, max_storage_io_requests=48, max_threads=8, max_vacuum_temp_files_after_query=18446744073709551615, numeric_cast_option=rounding, parquet_fast_read_bytes=16777216, parquet_max_block_size=8192, parse_datetime_ignore_remainder=1, prefer_broadcast_join=1, purge_duplicated_files_in_copy=0, query_flight_compression=LZ4, query_result_cache_allow_inconsistent=0, query_result_cache_max_bytes=1048576, query_result_cache_min_execute_secs=1, query_result_cache_ttl_secs=300, quoted_ident_case_sensitive=1, recluster_block_size=2104802410, recluster_timeout_secs=43200, replace_into_bloom_pruning_max_column_number=4, replace_into_shuffle_strategy=0, sandbox_tenant=, script_max_steps=10000, sort_spilling_batch_bytes=8388608, sort_spilling_bytes_threshold_per_proc=0, sort_spilling_memory_ratio=60, sql_dialect=PostgreSQL, statement_queued_timeout_in_seconds=0, storage_fetch_part_num=2, storage_io_max_page_bytes_for_read=524288, storage_io_min_bytes_for_seek=48, storage_read_buffer_size=1048576, table_lock_expire_secs=20, timezone=UTC, unquoted_ident_case_sensitive=0, use_parquet2=0, scope: SESSION
6999
extra:
70100
has_profile: false
71-
```
101+
```

0 commit comments

Comments
 (0)