2023-05-30 18:56:48 +00:00
|
|
|
#!/usr/bin/env bash
|
2023-05-31 12:20:28 +00:00
|
|
|
# Tags: no-fasttest, no-random-settings
|
2023-05-30 18:56:48 +00:00
|
|
|
|
|
|
|
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
|
|
|
# shellcheck source=../shell_config.sh
|
|
|
|
. "$CUR_DIR"/../shell_config.sh
|
|
|
|
|
|
|
|
${CLICKHOUSE_CLIENT} -nm --query "
|
|
|
|
DROP TABLE IF EXISTS test_s3;
|
|
|
|
|
|
|
|
CREATE TABLE test_s3 (a UInt64, b UInt64)
|
|
|
|
ENGINE = MergeTree ORDER BY a
|
2023-05-30 19:00:15 +00:00
|
|
|
SETTINGS disk = 's3_disk', min_bytes_for_wide_part = 0;
|
2023-05-30 18:56:48 +00:00
|
|
|
|
|
|
|
INSERT INTO test_s3 SELECT number, number FROM numbers(1000000);
|
|
|
|
"
|
|
|
|
query="SELECT sum(b) FROM test_s3 WHERE a >= 100000 AND a <= 102000"
|
|
|
|
query_id=$(${CLICKHOUSE_CLIENT} --query "select queryID() from ($query) limit 1" 2>&1)
|
|
|
|
${CLICKHOUSE_CLIENT} --query "SYSTEM FLUSH LOGS"
|
|
|
|
${CLICKHOUSE_CLIENT} -nm --query "
|
|
|
|
SELECT
|
|
|
|
ProfileEvents['S3ReadRequestsCount'],
|
|
|
|
ProfileEvents['ReadBufferFromS3Bytes'],
|
|
|
|
ProfileEvents['ReadCompressedBytes']
|
|
|
|
FROM system.query_log
|
|
|
|
WHERE type = 'QueryFinish'
|
|
|
|
AND current_database = currentDatabase()
|
|
|
|
AND query_id='$query_id';
|
|
|
|
"
|