query_cache
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.
Shows the content of the query cache.
Columns:
- query(String) — Query string.
- query_id(String) — ID of the query.
- result_size(UInt64) — Size of the query cache entry.
- tag(LowCardinality(String)) — Tag of the query cache entry.
- stale(UInt8) — If the query cache entry is stale.
- shared(UInt8) — If the query cache entry is shared between multiple users.
- compressed(UInt8) — If the query cache entry is compressed.
- expires_at(DateTime) — When the query cache entry becomes stale.
- key_hash(UInt64) — A hash of the query string, used as a key to find query cache entries.
Example
SELECT * FROM system.query_cache FORMAT Vertical;
Row 1:
──────
query:       SELECT 1 SETTINGS use_query_cache = 1
query_id:    7c28bbbb-753b-4eba-98b1-efcbe2b9bdf6
result_size: 128
tag:
stale:       0
shared:      0
compressed:  1
expires_at:  2023-10-13 13:35:45
key_hash:    12188185624808016954
1 row in set. Elapsed: 0.004 sec.