events_raw table in ClickHouse stores one row per query execution. This page documents every column with its type, what it means, and when the value is useful for diagnosis.
The table is partitioned by date (toDate(ts_start)) and ordered by ts_start for efficient time-range scans.
Timing
Identity
Query normalization replaces literals with placeholders (
$N). This means SELECT * FROM users WHERE id = 42 becomes SELECT * FROM users WHERE id = $1. No passwords, tokens, or PII are exported in query text.Query labels
Labels are parsed only from a
/* */ comment at the end of the query text, with no -- on its line before it or inside it. The comment must be well-formed sqlcommenter key='value' pairs separated by commas; otherwise no labels are recorded. Keys and values are URL-decoded. A pair is kept only if its decoded key and value use letters, digits and _ - . / : ,, with keys up to 65 bytes and values up to 1024 bytes; other pairs are dropped. Controlled by the pg_stat_ch.track_labels GUC (default: off).Query text is cut at 2,047 bytes, and text that reaches that length gets no labels. Error events carry no query text, so they have no labels. events_recent_1h keeps the columns it was created with, so it has no labels column.Label values are exported as written by the application. Don’t put PII, tokens, or secrets in sqlcommenter comments.Shared buffer usage
These columns show how queries interact with PostgreSQL’sshared_buffers cache. The cache hit ratio for a query is shared_blks_hit / (shared_blks_hit + shared_blks_read). Target above 99% for OLTP workloads.
Local buffer usage
Local buffers are used for temporary tables (CREATE TEMP TABLE). They are session-private and do not benefit from shared_buffers.
Temp file usage
Temp files are used whenwork_mem is insufficient for sorts, hash joins, or materialization. Unlike local buffers, these are always on disk. Non-zero values indicate work_mem pressure.
I/O timing
These columns show actual time spent on I/O operations, not just block counts. They separate storage bottlenecks from CPU bottlenecks.WAL usage
Write-Ahead Log metrics show write activity. Useful for replication bandwidth planning and understanding checkpoint behavior.CPU time
User vs system CPU time breakdown. Measured viagetrusage().
JIT compilation
JIT (Just-In-Time) compilation can speed up complex queries but has compilation overhead. These fields are zero when JIT is not triggered (query cost belowjit_above_cost).
Parallel query
Parallel query statistics show how many workers were planned vs actually launched.Error information
Error fields are populated when a query produces an error or warning (captured via PostgreSQL’semit_log_hook). For successful queries, err_elevel is 0.
The minimum captured severity is controlled by
pg_stat_ch.log_min_elevel (default: warning).

