mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
21 lines
594 B
SQL
21 lines
594 B
SQL
-- Tags: no-parallel
|
|
-- Tag no-parallel: Messes with internal cache
|
|
|
|
-- Start with empty query cache QC
|
|
SYSTEM DROP QUERY CACHE;
|
|
|
|
SELECT 1 SETTINGS use_query_cache = true;
|
|
SELECT 1 SETTINGS use_query_cache = true;
|
|
|
|
SYSTEM FLUSH LOGS;
|
|
SELECT ProfileEvents['QueryCacheHits'], ProfileEvents['QueryCacheMisses']
|
|
FROM system.query_log
|
|
WHERE type = 'QueryFinish'
|
|
AND current_database = currentDatabase()
|
|
AND query = 'SELECT 1 SETTINGS use_query_cache = true;'
|
|
ORDER BY event_time_microseconds;
|
|
|
|
-- (The 1st execution was a cache miss, the 2nd execution was a cache hit)
|
|
|
|
SYSTEM DROP QUERY CACHE;
|