Skip to main content
Skip to main content

system.processes

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.

This system table is used for implementing the SHOW PROCESSLIST query.

Columns:

  • is_initial_query (UInt8) — Whether this query comes directly from user or was issues by ClickHouse server in a scope of distributed query execution.
  • user (String) — The user who made the query. Keep in mind that for distributed processing, queries are sent to remote servers under the default user. The field contains the username for a specific query, not for a query that this query initiated.
  • query_id (String) — Query ID, if defined.
  • address (IPv6) — The IP address the query was made from. The same for distributed processing. To track where a distributed query was originally made from, look at system.processes on the query requestor server.
  • port (UInt16) — The client port the query was made from.
  • initial_user (String) — Name of the user who ran the initial query (for distributed query execution).
  • initial_query_id (String) — ID of the initial query (for distributed query execution).
  • initial_address (IPv6) — IP address that the parent query was launched from.
  • initial_port (UInt16) — The client port that was used to make the parent query.
  • interface (UInt8) — The interface which was used to send the query. TCP = 1, HTTP = 2, GRPC = 3, MYSQL = 4, POSTGRESQL = 5, LOCAL = 6, TCP_INTERSERVER = 7.
  • os_user (String) — Operating system username who runs clickhouse-client.
  • client_hostname (String) — Hostname of the client machine where the clickhouse-client or another TCP client is run.
  • client_name (String) — The clickhouse-client or another TCP client name.
  • client_revision (UInt64) — Revision of the clickhouse-client or another TCP client.
  • client_version_major (UInt64) — Major version of the clickhouse-client or another TCP client.
  • client_version_minor (UInt64) — Minor version of the clickhouse-client or another TCP client.
  • client_version_patch (UInt64) — Patch component of the clickhouse-client or another TCP client version.
  • http_method (UInt8) — HTTP method that initiated the query. Possible values: 0 — The query was launched from the TCP interface. 1 — GET method was used. 2 — POST method was used.
  • http_user_agent (String) — HTTP header UserAgent passed in the HTTP query.
  • http_referer (String) — HTTP header Referer passed in the HTTP query (contains an absolute or partial address of the page making the query).
  • forwarded_for (String) — HTTP header X-Forwarded-For passed in the HTTP query.
  • quota_key (String) — The quota key specified in the quotas setting (see keyed).
  • distributed_depth (UInt64) — The number of times query was retransmitted between server nodes internally.
  • elapsed (Float64) — The time in seconds since request execution started.
  • is_cancelled (UInt8) — Was query cancelled.
  • is_all_data_sent (UInt8) — Was all data sent to the client (in other words query had been finished on the server).
  • read_rows (UInt64) — The number of rows read from the table. For distributed processing, on the requestor server, this is the total for all remote servers.
  • read_bytes (UInt64) — The number of uncompressed bytes read from the table. For distributed processing, on the requestor server, this is the total for all remote servers.
  • total_rows_approx (UInt64) — The approximation of the total number of rows that should be read. For distributed processing, on the requestor server, this is the total for all remote servers. It can be updated during request processing, when new sources to process become known.
  • written_rows (UInt64) — The amount of rows written to the storage.
  • written_bytes (UInt64) — The amount of bytes written to the storage.
  • memory_usage (Int64) — Amount of RAM the query uses. It might not include some types of dedicated memory
  • peak_memory_usage (Int64) — The current peak of memory usage.
  • query (String) — The query text. For INSERT, it does not include the data to insert.
  • normalized_query_hash (UInt64) — A numeric hash value, such as it is identical for queries differ only by values of literals.
  • query_kind (String) — The type of the query - SELECT, INSERT, etc.
  • thread_ids (Array(UInt64)) — The list of identifiers of all threads which participated in this query.
  • ProfileEvents (Map(String, UInt64)) — ProfileEvents calculated for this query.
  • Settings (Map(String, String)) — The list of modified user-level settings.
  • current_database (String) — The name of the current database.
SELECT * FROM system.processes LIMIT 10 FORMAT Vertical;
Row 1:
──────
is_initial_query:     1
user:                 default
query_id:             35a360fa-3743-441d-8e1f-228c938268da
address:              ::ffff:172.23.0.1
port:                 47588
initial_user:         default
initial_query_id:     35a360fa-3743-441d-8e1f-228c938268da
initial_address:      ::ffff:172.23.0.1
initial_port:         47588
interface:            1
os_user:              bharatnc
client_hostname:      tower
client_name:          ClickHouse
client_revision:      54437
client_version_major: 20
client_version_minor: 7
client_version_patch: 2
http_method:          0
http_user_agent:
quota_key:
elapsed:              0.000582537
is_cancelled:         0
is_all_data_sent:     0
read_rows:            0
read_bytes:           0
total_rows_approx:    0
written_rows:         0
written_bytes:        0
memory_usage:         0
peak_memory_usage:    0
query:                SELECT * from system.processes LIMIT 10 FORMAT Vertical;
thread_ids:           [67]
ProfileEvents:        {'Query':1,'SelectQuery':1,'ReadCompressedBytes':36,'CompressedReadBufferBlocks':1,'CompressedReadBufferBytes':10,'IOBufferAllocs':1,'IOBufferAllocBytes':89,'ContextLock':15,'RWLockAcquiredReadLocks':1}
Settings:             {'background_pool_size':'32','load_balancing':'random','allow_suspicious_low_cardinality_types':'1','distributed_aggregation_memory_efficient':'1','skip_unavailable_shards':'1','log_queries':'1','max_bytes_before_external_group_by':'20000000000','max_bytes_before_external_sort':'20000000000','allow_introspection_functions':'1'}

1 rows in set. Elapsed: 0.002 sec.