Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change endless performance tests (5) #9469

Merged
merged 2 commits into from
Mar 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 5 additions & 7 deletions dbms/tests/performance/if_string_const.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
<test>
<type>once</type>
<type>loop</type>

<stop_conditions>
<any_of>
<average_speed_not_changing_for_ms>1000</average_speed_not_changing_for_ms>
<total_time_ms>10000</total_time_ms>
</any_of>
</stop_conditions>


<query>SELECT count() FROM system.numbers WHERE NOT ignore(rand() % 2 ? 'hello' : 'world')</query>
<query>SELECT count() FROM system.numbers WHERE NOT ignore(rand() % 2 ? 'hello' : '')</query>
<query>SELECT count() FROM system.numbers WHERE NOT ignore(rand() % 2 ? toFixedString('hello', 5) : toFixedString('world', 5))</query>
<query>SELECT count() FROM system.numbers WHERE NOT ignore(rand() % 2 ? '' : toFixedString('world', 5))</query>
<query>SELECT count() FROM numbers(1000000) WHERE NOT ignore(rand() % 2 ? 'hello' : 'world')</query>
<query>SELECT count() FROM numbers(1000000) WHERE NOT ignore(rand() % 2 ? 'hello' : '')</query>
<query>SELECT count() FROM numbers(1000000) WHERE NOT ignore(rand() % 2 ? toFixedString('hello', 5) : toFixedString('world', 5))</query>
<query>SELECT count() FROM numbers(1000000) WHERE NOT ignore(rand() % 2 ? '' : toFixedString('world', 5))</query>
</test>
19 changes: 12 additions & 7 deletions dbms/tests/performance/if_to_multiif.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
<test>
<type>once</type>
<type>loop</type>

<stop_conditions>
<any_of>
<average_speed_not_changing_for_ms>1000</average_speed_not_changing_for_ms>
<total_time_ms>10000</total_time_ms>
</any_of>
</stop_conditions>

<preconditions>
<!-- sum() does not work for String values, need to investigate what
this test meant. Disable for now. -->
<table_exists>nonexistent_table_if_multiif</table_exists>
<precondition>

<query><![CDATA[ WITH number AS x SELECT sum(x < 1 ? 1 : (x < 5 ? 2 : 3)) FROM system.numbers ]]></query>
<query><![CDATA[ WITH number AS x SELECT sum(x < 1 ? '1' : (x < 5 ? '2' : '3')) FROM system.numbers ]]></query>
<query><![CDATA[ WITH number AS x SELECT sum(x < 1 ? 1 : (x < 5 ? 2 : (x < 10 ? 3 : (x % 2 ? 4 : 5)))) FROM system.numbers ]]></query>
<query><![CDATA[ WITH number AS x SELECT sum(x < 1 ? '1' : (x < 5 ? '2' : (x < 10 ? '3' : (x % 2 ? '4' : '5')))) FROM system.numbers ]]></query>

<query><![CDATA[ WITH number AS x SELECT sum(x < 1 ? 1 : (x < 5 ? 2 : 3)) FROM numbers(1000000) ]]></query>
<query><![CDATA[ WITH number AS x SELECT sum(x < 1 ? '1' : (x < 5 ? '2' : '3')) FROM numbers(1000000) ]]></query>
<query><![CDATA[ WITH number AS x SELECT sum(x < 1 ? 1 : (x < 5 ? 2 : (x < 10 ? 3 : (x % 2 ? 4 : 5)))) FROM numbers(1000000) ]]></query>
<query><![CDATA[ WITH number AS x SELECT sum(x < 1 ? '1' : (x < 5 ? '2' : (x < 10 ? '3' : (x % 2 ? '4' : '5')))) FROM numbers(1000000) ]]></query>
<query><![CDATA[
WITH number AS x, x = 1 ? 1 : (x = 2 ? 2 : (x = 3 ? 3 : (x = 4 ? 4 : (x = 5 ? 5 : (x = 6 ? 6 : (x = 7 ? 7 : (x = 8 ? 8 : (x = 9 ? 9 : (x = 10 ? 10 : (x = 11 ? 11 : (x = 12 ? 12 : (x = 13 ? 13 : (x = 14 ? 14 : (x = 15 ? 15 : (x = 16 ? 16 : (x = 17 ? 17 : (x = 18 ? 18 : (x = 19 ? 19 : 20)))))))))))))))))) AS res SELECT sum(res) FROM system.numbers
WITH number AS x, x = 1 ? 1 : (x = 2 ? 2 : (x = 3 ? 3 : (x = 4 ? 4 : (x = 5 ? 5 : (x = 6 ? 6 : (x = 7 ? 7 : (x = 8 ? 8 : (x = 9 ? 9 : (x = 10 ? 10 : (x = 11 ? 11 : (x = 12 ? 12 : (x = 13 ? 13 : (x = 14 ? 14 : (x = 15 ? 15 : (x = 16 ? 16 : (x = 17 ? 17 : (x = 18 ? 18 : (x = 19 ? 19 : 20)))))))))))))))))) AS res SELECT sum(res) FROM numbers(1000000)
]]></query>
</test>
7 changes: 3 additions & 4 deletions dbms/tests/performance/information_value.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@
<type>loop</type>

<preconditions>
<table_exists>test.hits</table_exists>
<table_exists>hits_100m_single</table_exists>
</preconditions>

<stop_conditions>
<all_of>
<total_time_ms>10000</total_time_ms>
</all_of>
<any_of>
<average_speed_not_changing_for_ms>5000</average_speed_not_changing_for_ms>
<total_time_ms>20000</total_time_ms>
</any_of>
</stop_conditions>


<query>SELECT categoricalInformationValue(Age &lt; 15, IsMobile)</query>
<query>SELECT categoricalInformationValue(Age &lt; 15, Age &gt;= 15 and Age &lt; 30, Age &gt;= 30 and Age &lt; 45, Age &gt;= 45 and Age &lt; 60, Age &gt;= 60, IsMobile)</query>
<query>SELECT categoricalInformationValue(Age &lt; 15, IsMobile) from hits_100m_single</query>
<query>SELECT categoricalInformationValue(Age &lt; 15, Age &gt;= 15 and Age &lt; 30, Age &gt;= 30 and Age &lt; 45, Age &gt;= 45 and Age &lt; 60, Age &gt;= 60, IsMobile) from hits_100m_single</query>
</test>
12 changes: 6 additions & 6 deletions dbms/tests/performance/linear_regression.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,31 @@

<stop_conditions>
<any_of>
<average_speed_not_changing_for_ms>3000</average_speed_not_changing_for_ms>
<total_time_ms>10000</total_time_ms>
</any_of>
</stop_conditions>

<preconditions>
<table_exists>test.hits</table_exists>
<table_exists>hits_100m_single</table_exists>
</preconditions>


<create_query>DROP TABLE IF EXISTS test_model</create_query>
<create_query>CREATE TABLE test_model engine = Memory as select stochasticLinearRegressionState(0.0001)(Age, Income, ParamPrice, Robotness, RefererHash) as state from test.hits</create_query>

<!-- Check model fit -->
<query>WITH (SELECT stochasticLinearRegressionState(0.0001, 0, 15)(Age, Income, ParamPrice, Robotness, RefererHash) FROM test.hits) AS model SELECT 1</query>
<query>SELECT stochasticLinearRegression(Age, Income, ParamPrice, Robotness, RefererHash) FROM test.hits</query>
<query>SELECT stochasticLinearRegressionState(0.0001, 0, 15)(Age, Income, ParamPrice, Robotness, RefererHash) FROM test.hits FORMAT Null</query>
<query>SELECT stochasticLinearRegression(Age, Income, ParamPrice, Robotness, RefererHash) FROM test.hits FORMAT Null</query>

<!-- Check model fit with Momentum -->
<query>WITH (SELECT stochasticLinearRegressionState(0.0001, 0, 15, 'Momentum')(Age, Income, ParamPrice, Robotness, RefererHash) FROM test.hits) AS model SELECT 1</query>
<query>SELECT stochasticLinearRegressionState(0.0001, 0, 15, 'Momentum')(Age, Income, ParamPrice, Robotness, RefererHash) FROM hits_100m_single FORMAT Null</query>

<!-- Check model fit with Nesterov -->
<query>WITH (SELECT stochasticLinearRegressionState(0.0001, 0, 15, 'Nesterov')(Age, Income, ParamPrice, Robotness, RefererHash) FROM test.hits) AS model SELECT 1</query>
<query>SELECT stochasticLinearRegressionState(0.0001, 0, 15, 'Nesterov')(Age, Income, ParamPrice, Robotness, RefererHash) FROM hits_100m_single FORMAT Null</query>

<!-- Check model predict -->
<query>with (SELECT state FROM test_model) as model select evalMLMethod(model, Income, ParamPrice, Robotness, RefererHash) from test.hits</query>
<query>WITH (SELECT state FROM test_model) AS model SELECT evalMLMethod(model, Income, ParamPrice, Robotness, RefererHash) FROM hits_100m_single FORMAT Null</query>

<drop_query>DROP TABLE IF EXISTS test_model</drop_query>
</test>
17 changes: 8 additions & 9 deletions dbms/tests/performance/random_printable_ascii.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
<test>
<type>once</type>
<type>loop</type>

<stop_conditions>
<any_of>
<average_speed_not_changing_for_ms>4000</average_speed_not_changing_for_ms>
<total_time_ms>10000</total_time_ms>
</any_of>
</stop_conditions>


<query>SELECT count() FROM system.numbers WHERE NOT ignore(randomPrintableASCII(10))</query>
<query>SELECT count() FROM system.numbers WHERE NOT ignore(randomPrintableASCII(100))</query>
<query>SELECT count() FROM system.numbers WHERE NOT ignore(randomPrintableASCII(1000))</query>
<query>SELECT count() FROM system.numbers WHERE NOT ignore(randomPrintableASCII(10000))</query>
<query>SELECT count() FROM system.numbers WHERE NOT ignore(randomPrintableASCII(rand() % 10))</query>
<query>SELECT count() FROM system.numbers WHERE NOT ignore(randomPrintableASCII(rand() % 100))</query>
<query>SELECT count() FROM system.numbers WHERE NOT ignore(randomPrintableASCII(rand() % 1000))</query>
<query>SELECT count() FROM numbers(1000000) WHERE NOT ignore(randomPrintableASCII(10))</query>
<query>SELECT count() FROM numbers(1000000) WHERE NOT ignore(randomPrintableASCII(100))</query>
<query>SELECT count() FROM numbers(1000000) WHERE NOT ignore(randomPrintableASCII(1000))</query>
<query>SELECT count() FROM numbers(1000000) WHERE NOT ignore(randomPrintableASCII(10000))</query>
<query>SELECT count() FROM numbers(1000000) WHERE NOT ignore(randomPrintableASCII(rand() % 10))</query>
<query>SELECT count() FROM numbers(1000000) WHERE NOT ignore(randomPrintableASCII(rand() % 100))</query>
<query>SELECT count() FROM numbers(1000000) WHERE NOT ignore(randomPrintableASCII(rand() % 1000))</query>
</test>