Extend tests for compression of query cache entries

This commit is contained in:
Robert Schulze 2023-04-03 10:47:29 +00:00
parent e79343c169
commit 11556a23ad
No known key found for this signature in database
GPG Key ID: 26703B55FB13728A
6 changed files with 6994 additions and 26 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,444 @@
-- Tags: no-parallel
-- Tag no-parallel: Messes with internal cache
SET allow_experimental_query_cache = true;
SYSTEM DROP QUERY CACHE;
DROP TABLE IF EXISTS t;
-- Create test table with lot's of rows
CREATE TABLE t(c String) ENGINE=MergeTree ORDER BY c;
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
INSERT INTO t values ('abc') ('def') ('abc') ('jkl');
OPTIMIZE TABLE t FINAL;
-- Run query which, store *compressed* result in query cache
SELECT '-- insert with enabled compression';
SELECT * FROM t ORDER BY c
SETTINGS use_query_cache = true, query_cache_compress_entries = true;
-- Run again to check that no bad things happen and that the result is as expected
SELECT '-- read from cache';
SELECT * FROM t ORDER BY c
SETTINGS use_query_cache = true;
SYSTEM DROP QUERY CACHE;
-- Run query which, store *uncompressed* result in query cache
SELECT '-- insert with disabled compression';
SELECT * FROM t ORDER BY c
SETTINGS use_query_cache = true, query_cache_compress_entries = false;
-- Run again to check that no bad things happen and that the result is as expected
SELECT '-- read from cache';
SELECT * FROM t ORDER BY c
SETTINGS use_query_cache = true;
DROP TABLE t;

View File

@ -1,12 +0,0 @@
-- Tags: no-parallel
-- Tag no-parallel: Messes with internal cache
SET allow_experimental_query_cache = true;
SYSTEM DROP QUERY CACHE;
-- Run query and store result in query cache but without compression which is on by default
SELECT 1 SETTINGS use_query_cache = true, query_cache_compress_entries = false;
-- Run again to check that no bad things happen and that the result is as expected
SELECT 1 SETTINGS use_query_cache = true;

View File

@ -1,3 +1,4 @@
-- insert with enabled squashing
abc
abc
abc
@ -66,7 +67,7 @@ jkl
jkl
jkl
jkl
-
-- read from cache
abc
abc
abc
@ -135,7 +136,7 @@ jkl
jkl
jkl
jkl
--------------------
-- insert with disabled squashing
abc
abc
abc
@ -204,7 +205,7 @@ jkl
jkl
jkl
jkl
-
-- read from cache
abc
abc
abc

View File

@ -9,6 +9,7 @@ DROP TABLE IF EXISTS t;
-- Create test table with "many" rows
CREATE TABLE t(c String) ENGINE=MergeTree ORDER BY c;
SYSTEM STOP MERGES t; -- retain multiple parts to make the SELECT process multiple chunks
INSERT INTO t values ('abc') ('def') ('ghi') ('jkl');
INSERT INTO t values ('abc') ('def') ('ghi') ('jkl');
INSERT INTO t values ('abc') ('def') ('ghi') ('jkl');
@ -28,21 +29,25 @@ INSERT INTO t values ('abc') ('def') ('ghi') ('jkl');
INSERT INTO t values ('abc') ('def') ('ghi') ('jkl');
-- Run query which reads multiple chunks (small max_block_size), cache result in query cache, force squashing of partial results
SELECT * FROM t ORDER BY c SETTINGS max_block_size = 2, use_query_cache = true, query_cache_squash_partial_results = true;
SELECT '-';
SELECT '-- insert with enabled squashing';
SELECT * FROM t ORDER BY c
SETTINGS max_block_size = 2, use_query_cache = true, query_cache_squash_partial_results = true;
-- Run again to check that no bad things happen and that the result is as expected
SELECT * FROM t ORDER BY c SETTINGS max_block_size = 2, use_query_cache = true;
SELECT '-- read from cache';
SELECT * FROM t ORDER BY c
SETTINGS max_block_size = 2, use_query_cache = true;
SELECT '--------------------';
SYSTEM DROP QUERY CACHE;
-- Run query which reads multiple chunks (small max_block_size), cache result in query cache, but **disable** squashing of partial results
SELECT * FROM t ORDER BY c SETTINGS max_block_size = 2, use_query_cache = true, query_cache_squash_partial_results = false;
SELECT '-';
SELECT '-- insert with disabled squashing';
SELECT * FROM t ORDER BY c
SETTINGS max_block_size = 2, use_query_cache = true, query_cache_squash_partial_results = false;
-- Run again to check that no bad things happen and that the result is as expected
SELECT * FROM t ORDER BY c SETTINGS max_block_size = 2, use_query_cache = true;
SELECT '-- read from cache';
SELECT * FROM t ORDER BY c
SETTINGS max_block_size = 2, use_query_cache = true;
DROP TABLE t;