Skip to main content
Skip to main content

system.events

Querying in ClickHouse Cloud

The data in this system table is held locally on each node in ClickHouse Cloud. Obtaining a complete view of all data, therefore, requires the clusterAllReplicas function. See here for further details.

Contains information about the number of events that have occurred in the system. For example, in the table, you can find how many SELECT queries were processed since the ClickHouse server started.

Columns:

  • event (String) — Event name.
  • value (UInt64) — Number of events occurred.
  • description (String) — Event description.

The following events are available in ClickHouse OSS:

EventDescription
QueryNumber of queries to be interpreted and potentially executed. Does not include queries that failed to parse or were rejected due to AST size limits, quota limits or limits on the number of simultaneously running queries. May include internal queries initiated by ClickHouse itself. Does not count subqueries.
SelectQuerySame as Query, but only for SELECT queries.
InitialQuerySame as Query, but only counts initial queries (see is_initial_query).
InitialSelectQuerySame as InitialQuery, but only for SELECT queries.
QueriesWithSubqueriesCount queries with all subqueries
SelectQueriesWithSubqueriesCount SELECT queries with all subqueries
FileOpenNumber of files opened.
SeekNumber of times the 'lseek' function was called.
ReadBufferFromFileDescriptorReadNumber of reads (read/pread) from a file descriptor. Does not include sockets.
ReadBufferFromFileDescriptorReadBytesNumber of bytes read from file descriptors. If the file is compressed, this will show the compressed data size.
WriteBufferFromFileDescriptorWriteNumber of writes (write/pwrite) to a file descriptor. Does not include sockets.
WriteBufferFromFileDescriptorWriteBytesNumber of bytes written to file descriptors. If the file is compressed, this will show compressed data size.
FileSyncNumber of times the F_FULLFSYNC/fsync/fdatasync function was called for files.
FileSyncElapsedMicrosecondsTotal time spent waiting for F_FULLFSYNC/fsync/fdatasync syscall for files.
IOBufferAllocsNumber of allocations of IO buffers (for ReadBuffer/WriteBuffer).
IOBufferAllocBytesNumber of bytes allocated for IO buffers (for ReadBuffer/WriteBuffer).
DiskReadElapsedMicrosecondsTotal time spent waiting for read syscall. This include reads from page cache.
DiskWriteElapsedMicrosecondsTotal time spent waiting for write syscall. This include writes to page cache.
NetworkReceiveElapsedMicrosecondsTotal time spent waiting for data to receive or receiving data from network. Only ClickHouse-related network interaction is included, not by 3rd party libraries.
NetworkSendElapsedMicrosecondsTotal time spent waiting for data to send to network or sending data to network. Only ClickHouse-related network interaction is included, not by 3rd party libraries.
NetworkReceiveBytesTotal number of bytes received from network. Only ClickHouse-related network interaction is included, not by 3rd party libraries.
NetworkSendBytesTotal number of bytes send to network. Only ClickHouse-related network interaction is included, not by 3rd party libraries.
GlobalThreadPoolExpansionsCounts the total number of times new threads have been added to the global thread pool. This metric indicates the frequency of expansions in the global thread pool to accommodate increased processing demands.
GlobalThreadPoolThreadCreationMicrosecondsTotal time spent waiting for new threads to start.
GlobalThreadPoolLockWaitMicrosecondsTotal time threads have spent waiting for locks in the global thread pool.
GlobalThreadPoolJobsCounts the number of jobs that have been pushed to the global thread pool.
GlobalThreadPoolJobWaitTimeMicrosecondsMeasures the elapsed time from when a job is scheduled in the thread pool to when it is picked up for execution by a worker thread. This metric helps identify delays in job processing, indicating the responsiveness of the thread pool to new tasks.
LocalThreadPoolExpansionsCounts the total number of times threads have been borrowed from the global thread pool to expand local thread pools.
LocalThreadPoolShrinksCounts the total number of times threads have been returned to the global thread pool from local thread pools.
LocalThreadPoolThreadCreationMicrosecondsTotal time local thread pools have spent waiting to borrow a thread from the global pool.
LocalThreadPoolJobsCounts the number of jobs that have been pushed to the local thread pools.
LocalThreadPoolBusyMicrosecondsTotal time threads have spent executing the actual work.
LocalThreadPoolJobWaitTimeMicrosecondsMeasures the elapsed time from when a job is scheduled in the thread pool to when it is picked up for execution by a worker thread. This metric helps identify delays in job processing, indicating the responsiveness of the thread pool to new tasks.
QueryPlanOptimizeMicrosecondsTotal time spent executing query plan optimizations.
ContextLockNumber of times the lock of Context was acquired or tried to acquire. This is global lock.
RWLockAcquiredReadLocksNumber of times a read lock was acquired (in a heavy RWLock).
QueryProfilerSignalOverrunsNumber of times we drop processing of a query profiler signal due to overrun plus the number of signals that OS has not delivered due to overrun.
QueryProfilerRunsNumber of times QueryProfiler had been run.
MainConfigLoadsNumber of times the main configuration was reloaded.
ServerStartupMillisecondsTime elapsed from starting server to listening to sockets in milliseconds
AsyncLoaderWaitMicrosecondsTotal time a query was waiting for async loader jobs.
LogTraceNumber of log messages with level Trace
LogDebugNumber of log messages with level Debug
LogInfoNumber of log messages with level Info
LogWarningNumber of log messages with level Warning
LoggerElapsedNanosecondsCumulative time spend in logging
InterfaceNativeSendBytesNumber of bytes sent through native interfaces
InterfaceNativeReceiveBytesNumber of bytes received through native interfaces
MemoryWorkerRunNumber of runs done by MemoryWorker in background
MemoryWorkerRunElapsedMicrosecondsTotal time spent by MemoryWorker for background work
AsyncLoggingFileLogTotalMessagesHow many messages (accepted or dropped) have been sent to the async queue for the file log
AsyncLoggingErrorFileLogTotalMessagesHow many messages (accepted or dropped) have been sent to the async queue for the error file log
AsyncLoggingTextLogTotalMessagesHow many messages (accepted or dropped) have been sent to the async queue for the text_log

You can find all supported events in source file src/Common/ProfileEvents.cpp.

Example

SELECT * FROM system.events LIMIT 5
┌─event─────────────────────────────────┬─value─┬─description────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Query                                 │    12 │ Number of queries to be interpreted and potentially executed. Does not include queries that failed to parse or were rejected due to AST size limits, quota limits or limits on the number of simultaneously running queries. May include internal queries initiated by ClickHouse itself. Does not count subqueries.                  │
│ SelectQuery                           │     8 │ Same as Query, but only for SELECT queries.                                                                                                                                                                                                                │
│ FileOpen                              │    73 │ Number of files opened.                                                                                                                                                                                                                                    │
│ ReadBufferFromFileDescriptorRead      │   155 │ Number of reads (read/pread) from a file descriptor. Does not include sockets.                                                                                                                                                                             │
│ ReadBufferFromFileDescriptorReadBytes │  9931 │ Number of bytes read from file descriptors. If the file is compressed, this will show the compressed data size.                                                                                                                                              │
└───────────────────────────────────────┴───────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

See Also