跳到主要内容
跳到主要内容

system.events

在 ClickHouse Cloud 中查询

此系统表中的数据在 ClickHouse Cloud 中的每个节点上本地保存。因此,要获得所有数据的完整视图,需要使用 clusterAllReplicas 函数。有关进一步的详细信息,请参见 这里

包含系统中发生事件的数量的信息。例如,在该表中,您可以找出自 ClickHouse 服务器启动以来处理了多少个 SELECT 查询。

列:

  • event (String) — 事件名称。
  • value (UInt64) — 发生事件的数量。
  • description (String) — 事件描述。
  • name (String) — event 的别名。

您可以在源文件 src/Common/ProfileEvents.cpp 中找到所有支持的事件。

示例

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.                                                                                                                                              │
└───────────────────────────────────────┴───────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

另请参阅