vsql_stat_ch records one event for every statement the server finishes and
ships them to ClickHouse in batches. Query history then lives somewhere you can
aggregate it, without a collector process between the two. It speaks
ClickHouse’s native protocol or HTTP, and you can switch between them while the
server is running.
Install
vsql_stat_ch is not bundled with the server, so build it before installing it.
Clone the repository with its submodules, because it vendors a ClickHouse
client:
vsql_stat_ch.veb into the directory named by the veb_dir
system variable, then install it:
What it adds
It adds a capture path, a set of settings, and a set of status counters, and no SQL functions.Example
Point it at a ClickHouse instance and start capturing:events_dropped climbing means the queue filled faster than it drained, so
either ClickHouse is slow to answer or queue_capacity is too small for the
statement rate.
Statement text is truncated at
statement_max_bytes, and statement text can
carry literals from your data. Decide what your ClickHouse table is allowed to
hold before you turn capture on.See also
- Managing extensions — how extension settings are read and written
- Preview capabilities — what the preview flag turns on and what it promises
- Available extensions — the full catalog
- villagesql/vsql-stat-ch — source, the event schema, and the known limitations

