跳到主要内容
跳到主要内容
编辑此页

user_processes

在 ClickHouse Cloud 中查询

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

此系统表可用于获取用户内存使用情况和 ProfileEvents 的概述。

  • user (String) — 用户名。
  • memory_usage (Int64) – 用户所有进程使用的 RAM 总和。它可能不包括某些类型的专用内存。请参阅 max_memory_usage 设置。
  • peak_memory_usage (Int64) — 用户的峰值内存使用量。当用户没有运行查询时,可以重置它。
  • ProfileEvents (Map(String, UInt64)) – 衡量用户不同指标的 ProfileEvents 摘要。它们的描述可以在表 system.events 中找到
SELECT * FROM system.user_processes LIMIT 10 FORMAT Vertical;
Row 1:
──────
user: default
memory_usage: 9832
peak_memory_usage: 9832
ProfileEvents: {'Query':5,'SelectQuery':5,'QueriesWithSubqueries':38,'SelectQueriesWithSubqueries':38,'QueryTimeMicroseconds':842048,'SelectQueryTimeMicroseconds':842048,'ReadBufferFromFileDescriptorRead':6,'ReadBufferFromFileDescriptorReadBytes':234,'IOBufferAllocs':3,'IOBufferAllocBytes':98493,'ArenaAllocChunks':283,'ArenaAllocBytes':1482752,'FunctionExecute':670,'TableFunctionExecute':16,'DiskReadElapsedMicroseconds':19,'NetworkSendElapsedMicroseconds':684,'NetworkSendBytes':139498,'SelectedRows':6076,'SelectedBytes':685802,'ContextLock':1140,'RWLockAcquiredReadLocks':193,'RWLockReadersWaitMilliseconds':4,'RealTimeMicroseconds':1585163,'UserTimeMicroseconds':889767,'SystemTimeMicroseconds':13630,'SoftPageFaults':1947,'OSCPUWaitMicroseconds':6,'OSCPUVirtualTimeMicroseconds':903251,'OSReadChars':28631,'OSWriteChars':28888,'QueryProfilerRuns':3,'LogTrace':79,'LogDebug':24}

1 row in set. Elapsed: 0.010 sec.