mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-19 14:11:58 +00:00
325c6bdf3d
Reasons: - The cache will at some point store intermediate results as opposed to only query results. We should change the terminology now without having to worry about backward compat. - Equivalent caches in MySQL (1) and Starrocks (2) are called "query cache". - The new name is ca. 13.8% more catchy. (1) https://dev.mysql.com/doc/refman/5.6/en/query-cache.html (2) https://docs.starrocks.io/en-us/2.5/using_starrocks/query_cache
32 lines
846 B
SQL
32 lines
846 B
SQL
-- Tags: no-fasttest, no-parallel, long
|
|
-- Tag no-fasttest: Test runtime is > 6 sec
|
|
-- Tag long: Test runtime is > 6 sec
|
|
-- Tag no-parallel: Messes with internal cache
|
|
|
|
SET allow_experimental_query_cache = true;
|
|
|
|
SYSTEM DROP QUERY CACHE;
|
|
|
|
-- Cache query result into query cache with a TTL of 3 sec
|
|
SELECT 1 SETTINGS use_query_cache = true, query_cache_ttl = 3;
|
|
|
|
-- Expect one non-stale cache entry
|
|
SELECT COUNT(*) FROM system.query_cache;
|
|
SELECT stale FROM system.query_cache;
|
|
|
|
-- Wait until entry is expired
|
|
SELECT sleep(3);
|
|
SELECT sleep(3);
|
|
SELECT stale FROM system.query_cache;
|
|
|
|
SELECT '---';
|
|
|
|
-- Run same query as before
|
|
SELECT 1 SETTINGS use_query_cache = true, query_cache_ttl = 3;
|
|
|
|
-- The entry should have been refreshed (non-stale)
|
|
SELECT COUNT(*) FROM system.query_cache;
|
|
SELECT stale FROM system.query_cache;
|
|
|
|
SYSTEM DROP QUERY CACHE;
|