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.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).

