Last active
October 24, 2024 10:20
-
-
Save detj/830e2d6d2415f7b49af3dad740e32981 to your computer and use it in GitHub Desktop.
ClickHouse Management Queries
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-------------- | |
-- query cache | |
-------------- | |
-- see full details of query cache entries | |
SELECT | |
substring(query, 1, 30), | |
result_size, | |
tag, | |
stale, | |
shared, | |
compressed, | |
expires_at, | |
key_hash | |
FROM system.query_cache | |
ORDER BY expires_at DESC | |
-- see details of query cache usage from query log | |
SELECT | |
substring(query, 1, 40), | |
query_cache_usage, | |
query_start_time, | |
query_duration_ms | |
FROM system.query_log | |
WHERE query_cache_usage IN ('Write', 'Read') | |
ORDER BY | |
query_start_time DESC, | |
query_duration_ms DESC | |
LIMIT 100 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment