mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-16 19:32:07 +00:00
dc6810601a
This is a very ugly hack that breaks artifacts, since after this query_log is incomplete in artifacts. Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
32 lines
902 B
SQL
32 lines
902 B
SQL
-- Tags: no-parallel
|
|
-- Tag no-parallel: Messes with internal cache
|
|
|
|
-- Start with empty query cache QC
|
|
SYSTEM DROP QUERY CACHE;
|
|
|
|
-- Run a query with QC on. The first execution is a QC miss.
|
|
SELECT '---';
|
|
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;';
|
|
|
|
|
|
-- Run previous query again with query cache on
|
|
SELECT '---';
|
|
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;
|
|
|
|
SYSTEM DROP QUERY CACHE;
|