From bab4b3b042765fb68b91e8643fd702b8c35a3759 Mon Sep 17 00:00:00 2001 From: proller Date: Mon, 17 Jul 2017 18:36:27 +0300 Subject: [PATCH] Add some perf tests --- .../performance/simple/system_numbers.xml | 62 ++++++++++++++ dbms/tests/performance/simple/test_hits.xml | 80 +++++++++++++++++++ 2 files changed, 142 insertions(+) create mode 100644 dbms/tests/performance/simple/system_numbers.xml create mode 100644 dbms/tests/performance/simple/test_hits.xml diff --git a/dbms/tests/performance/simple/system_numbers.xml b/dbms/tests/performance/simple/system_numbers.xml new file mode 100644 index 00000000000..2a52de886f8 --- /dev/null +++ b/dbms/tests/performance/simple/system_numbers.xml @@ -0,0 +1,62 @@ + +wip +once + + + + 10000 + 1000 + + + + + + + + + + + +SELECT count() FROM system.numbers WHERE NOT ignore(rand()) + +SELECT count() FROM system.numbers WHERE NOT ignore(intHash64(number)) + +SELECT count() FROM system.numbers WHERE NOT ignore(intHash32(number)) + +SELECT count() FROM system.numbers WHERE NOT ignore(toString(number)) + +SELECT count() FROM system.numbers WHERE NOT ignore(reinterpretAsString(number)) + + +SELECT count() FROM system.numbers WHERE NOT ignore(number / 7) + +SELECT count() FROM system.numbers WHERE NOT ignore(number % 7) + +SELECT count() FROM system.numbers WHERE NOT ignore(number % 34908756) + +SELECT number % 1000 AS k, count() FROM system.numbers GROUP BY k + +SELECT number % 100000 AS k, count() FROM system.numbers GROUP BY k + +SELECT number % 1000000 AS k, count() FROM system.numbers GROUP BY k + +SELECT number % 10000000 AS k, count() FROM system.numbers GROUP BY k + +SELECT number % 500000000 AS k, count() FROM system.numbers GROUP BY k + + + + + +SELECT count() FROM system.numbers WHERE NOT ignore(materialize('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx') AS s, concat(s,s,s,s,s,s,s,s,s,s) AS t, concat(t,t,t,t,t,t,t,t,t,t) AS u) SETTINGS max_block_size = 1000 + + diff --git a/dbms/tests/performance/simple/test_hits.xml b/dbms/tests/performance/simple/test_hits.xml new file mode 100644 index 00000000000..2aebef8d71a --- /dev/null +++ b/dbms/tests/performance/simple/test_hits.xml @@ -0,0 +1,80 @@ + +test.hits misc +once + + + + 10000 + 1000 + + + + + + + + + + + test.hits + + + + +SELECT count() FROM test.hits WHERE NOT ignore(cityHash64(SearchPhrase)) SETTINGS max_threads = 1 + + +SELECT count() FROM test.hits WHERE NOT ignore(farmHash64(SearchPhrase)) SETTINGS max_threads = 1 + +SELECT count() FROM test.hits WHERE NOT ignore(metroHash64(SearchPhrase)) SETTINGS max_threads = 1 + +SELECT count() FROM test.hits WHERE NOT ignore(sipHash64(SearchPhrase)) SETTINGS max_threads = 1 + +SELECT count() FROM test.hits WHERE NOT ignore(MD5(SearchPhrase)) SETTINGS max_threads = 1 + +SELECT count() FROM test.hits WHERE NOT ignore(MD5(URL)) SETTINGS max_threads = 1 + +SELECT count() FROM test.hits WHERE NOT ignore(cityHash64(URL)) SETTINGS max_threads = 1 + +SELECT count() FROM test.hits WHERE NOT ignore(sipHash64(URL)) SETTINGS max_threads = 1 + +SELECT count() FROM test.hits WHERE NOT ignore(cityHash64(PageCharset)) SETTINGS max_threads = 1 + +SELECT count() FROM test.hits WHERE URL LIKE '%metrika%' SETTINGS max_threads = 1 + +SELECT count() FROM test.hits WHERE positionCaseInsensitiveUTF8(URL, 'новости') != 0 SETTINGS max_threads = 1 + +SELECT count() FROM test.hits WHERE match(URL, '^https?://(?:www\\.)?metri[kc]a\\.yandex\\.(?:ru|com|com\\.tr|ua|by|kz)/.+?2014') SETTINGS max_threads = 1 + + + +SELECT SearchEngineID, SearchPhrase, RegionID FROM test.hits GROUP BY SearchEngineID, SearchPhrase, RegionID ORDER BY count() DESC LIMIT 10 SETTINGS max_threads = 1 + +SELECT count() FROM test.hits WHERE NOT ignore(toMonday(EventTime)) SETTINGS max_threads = 1 + +SELECT count() FROM test.hits WHERE NOT ignore(cutQueryString(URL)) SETTINGS max_threads = 1 + +SELECT quantilesIf(0.5, 0.9)(SendTiming, SendTiming > 0) FROM test.hits SETTINGS max_threads = 1 + +SELECT quantilesTimingIf(0.5, 0.9)(SendTiming, SendTiming > 0) FROM test.hits SETTINGS max_threads = 1 + +SELECT quantilesExactIf(0.5, 0.9)(SendTiming, SendTiming > 0) FROM test.hits SETTINGS max_threads = 1 + +SELECT quantilesTDigestIf(0.5, 0.9)(SendTiming, SendTiming > 0) FROM test.hits SETTINGS max_threads = 1 + +SELECT uniq(UserID) FROM test.hits SETTINGS max_threads = 1 + +SELECT uniqCombined(UserID) FROM test.hits SETTINGS max_threads = 1 + +SELECT uniqExact(UserID) FROM test.hits SETTINGS max_threads = 1 + +SELECT RegionID, uniq(UserID) FROM test.hits GROUP BY RegionID SETTINGS max_threads = 1 + +SELECT count() FROM test.hits WHERE NOT ignore(*) SETTINGS max_threads = 1 + +