ClickHouse/tests/queries/0_stateless/02226_s3_with_cache.sql

43 lines
1.5 KiB
MySQL
Raw Normal View History

2022-02-25 10:04:16 +00:00
-- Tags: no-parallel, no-fasttest
CREATE TABLE test (key UInt32, value String) Engine=MergeTree() ORDER BY key SETTINGS storage_policy='s3_cache';
INSERT INTO test SELECT * FROM generateRandom('key UInt32, value String') LIMIT 100000000;
SET remote_filesystem_read_method='threadpool';
SELECT 1, * FROM test LIMIT 10 FORMAT Null;
SYSTEM FLUSH LOGS;
SELECT query,
2022-03-01 10:57:14 +00:00
ProfileEvents['RemoteFSReadBytes'] > 0 as remote_fs_read,
ProfileEvents['RemoteFSCacheReadBytes'] > 0 as remote_fs_cache_read,
ProfileEvents['RemoteFSCacheDownloadBytes'] > 0 as remote_fs_read_and_download
2022-02-25 10:04:16 +00:00
FROM system.query_log
WHERE query LIKE 'SELECT 1, * FROM test LIMIT%'
AND type = 'QueryFinish'
2022-03-01 10:57:14 +00:00
AND current_database = currentDatabase()
2022-02-25 10:04:16 +00:00
ORDER BY query_start_time DESC
LIMIT 1;
SELECT * FROM test WHERE value LIKE '%abc%' ORDER BY value LIMIT 10 FORMAT Null;
SELECT * FROM test ORDER BY value LIMIT 10 FORMAT Null;
SELECT * FROM test WHERE value LIKE '%dba%' ORDER BY value LIMIT 10 FORMAT Null;
SET remote_filesystem_read_method='read';
SELECT 2, * FROM test LIMIT 10 FORMAT Null;
SYSTEM FLUSH LOGS;
SELECT query,
2022-03-01 10:57:14 +00:00
ProfileEvents['RemoteFSReadBytes'] > 0 as remote_fs_read,
ProfileEvents['RemoteFSCacheReadBytes'] > 0 as remote_fs_cache_read,
ProfileEvents['RemoteFSCacheDownloadBytes'] > 0 as remote_fs_read_and_download
2022-02-25 10:04:16 +00:00
FROM system.query_log
WHERE query LIKE 'SELECT 2, * FROM test LIMIT%'
AND type = 'QueryFinish'
2022-03-01 10:57:14 +00:00
AND current_database = currentDatabase()
2022-02-25 10:04:16 +00:00
ORDER BY query_start_time DESC
LIMIT 1;
2022-03-01 10:57:14 +00:00
DROP TABLE test NO DELAY;