Merge pull request #5420 from vitlibar/performance-test-for-json-extract

Performance test for the functions JSONExtract*
This commit is contained in:
alexey-milovidov 2019-05-26 21:23:31 +03:00 committed by GitHub
commit d7a33b9104
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,44 @@
<test>
<name>json_extract</name>
<type>once</type>
<stop_conditions>
<any_of>
<average_speed_not_changing_for_ms>1000</average_speed_not_changing_for_ms>
<total_time_ms>2000</total_time_ms>
</any_of>
</stop_conditions>
<main_metric>
<max_rows_per_second />
<max_bytes_per_second />
<avg_rows_per_second />
<avg_bytes_per_second />
</main_metric>
<substitutions>
<substitution>
<name>json</name>
<values>
<value>'{"sparam":"test_string","nparam": 772}'</value>
<value>'{"sparam":{"nested_1":"test_string","nested_2":"test_2"}, "nparam":8495, "fparam":{"nested_1":91.15,"nested_2":[334, 89.05, 1000.01]}, "bparam":false}'</value>
</values>
</substitution>
<substitution>
<name>allow_simdjson</name>
<values>
<value>0</value>
<value>1</value>
</values>
</substitution>
</substitutions>
<query>SELECT count() FROM system.numbers WHERE NOT ignore(JSONExtractString(materialize({json}), 'sparam')) SETTINGS allow_simdjson={allow_simdjson}</query>
<query>SELECT count() FROM system.numbers WHERE NOT ignore(JSONExtractInt(materialize({json}), 'nparam')) SETTINGS allow_simdjson={allow_simdjson}</query>
<query>SELECT count() FROM system.numbers WHERE NOT ignore(JSONExtractUInt(materialize({json}), 'nparam')) SETTINGS allow_simdjson={allow_simdjson}</query>
<query>SELECT count() FROM system.numbers WHERE NOT ignore(JSONExtractFloat(materialize({json}), 'fparam')) SETTINGS allow_simdjson={allow_simdjson}</query>
<query>SELECT count() FROM system.numbers WHERE NOT ignore(JSONExtractBool(materialize({json}), 'bparam')) SETTINGS allow_simdjson={allow_simdjson}</query>
<query>SELECT count() FROM system.numbers WHERE NOT ignore(JSONExtractString(materialize({json}), 'sparam', 'nested_1')) SETTINGS allow_simdjson={allow_simdjson}</query>
<query>SELECT count() FROM system.numbers WHERE NOT ignore(JSONExtractFloat(materialize({json}), 'fparam', 'nested_2', -2)) SETTINGS allow_simdjson={allow_simdjson}</query>
<query>SELECT count() FROM system.numbers WHERE NOT ignore(JSONExtractRaw(materialize({json}), 'fparam')) SETTINGS allow_simdjson={allow_simdjson}</query>
</test>