ClickHouse/docs/en/operations/system-tables/query_metric_log.md
Pablo Marcos a561899da0 Rename system.query_log_metric to system.query_metric_log
Seems I had at the very beginning a brainfart and started using
query_log_metric instead of query_metric_log and it went on and on
:facepalm
2024-07-19 14:13:15 +00:00

2.5 KiB

slug
/en/operations/system-tables/query_metric_log

query_metric_log

Contains history of memory and metric values from table system.events for individual queries, periodically flushed to disk.

Once a query starts, data is collected at periodic intervals of query_metric_log_interval milliseconds (which is set to 1000 by default) and when the query finishes.

Columns:

  • hostname (LowCardinality(String)) — Hostname of the server executing the query.
  • event_date (Date) — Event date.
  • event_time (DateTime) — Event time.
  • event_time_microseconds (DateTime64) — Event time with microseconds resolution.
  • query_id (String) — ID of the query.

Example

SELECT * FROM system.query_metric_log LIMIT 1 FORMAT Vertical;
Row 1:
──────
hostname:                                                        clickhouse.eu-central1.internal
event_date:                                                      2020-09-05
event_time:                                                      2020-09-05 16:22:33
event_time_microseconds:                                         2020-09-05 16:22:33.196807
CurrentMetric_MemoryTracking:                                    480794407
CurrentMetric_MergesMutationsMemoryTracking:                     0
ProfileEvent_Query:                                              0
ProfileEvent_SelectQuery:                                        0
ProfileEvent_InsertQuery:                                        0
ProfileEvent_FailedQuery:                                        0
ProfileEvent_FailedSelectQuery:                                  0
...

See also