ClickHouse performance comparison

Tested Commits ?

ReferencePatched
ClickHouse local version 25.6.1.2286 (official build).
commit 14872a3176293fc242e45360efa1fbb74acbc65b
Author: Daniil Ivanik <61067749+divanik@users.noreply.github.com>
Date:   Sat Jun 7 16:36:23 2025 +0200

    Merge 075e9eb09b752a1071fe908ee0f14d862dbb9a52 into ba10709d43407fee47aa7cf7b87f1fe18e1242f5

Error Summary ?

Description
The query no. 2 of test 'set_index' has slowed down
The query no. 3 of test 'distinct_combinator' has slowed down
The query no. 21 of test 'int_parsing' has slowed down

Changes in Performance ?

Old, sNew, sRatio of speedup (-) or slowdown (+)Relative difference (new − old) / oldp < 0.01 thresholdTest#Query
0.020.024+1.209x0.2030.051set_index2SELECT count() FROM test_in WHERE -toInt64(a) IN (SELECT toInt64(rand(1)) FROM numbers(200000)) settings max_rows_to_read=200001, read_overflow_mode='break'
0.190.209+1.101x0.1010.101distinct_combinator3SELECT countIf(DISTINCT number % 10, number % 5 = 2) FROM numbers(100000000)
0.310.342+1.101x0.1010.101int_parsing21SELECT count() FROM hits_100m_single WHERE NOT ignore(toString(IsMobile)) SETTINGS max_threads = 1
0.210.23+1.091x0.0910.091distinct_combinator2SELECT sumIf(DISTINCT number % 10, number % 5 = 2) FROM numbers(100000000)
1.7361.586-1.095x-0.0870.086order_by_single_nullable1select b from t_opt_orderby order by b
0.0340.037+1.088x0.0860.06set_index0SELECT count() FROM test_in WHERE a IN (SELECT rand(1) FROM numbers(200000)) SETTINGS max_rows_to_read = 200001, read_overflow_mode = 'break'
0.0680.073+1.068x0.0670.05count_from_formats38SELECT count() FROM table_Values group by _file, _path FORMAT Null
0.0050.006+1.057x0.0610.033merge_tree_many_partitions0SELECT count() FROM bad_partitions

Unstable Queries ?

Old, sNew, sRelative difference (new - old)/oldp < 0.01 thresholdTest#Query
1.2861.225-0.0481.443number_formatting_formats5INSERT INTO table_JSONEachRow SELECT number FROM numbers(10000000) SETTINGS engine_file_truncate_on_insert = 1
0.0740.1310.7690.803map_update2 WITH (range(100), range(100))::Map(String, UInt64) AS m1, (range(30), range(30))::Map(String, UInt64) AS m2 SELECT count() FROM numbers(50000) WHERE NOT ignore(mapUpdate(materialize(m1), materialize(m2)))
0.3880.5050.30.621position_empty_needle0select position(materialize('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'), '') from numbers(100000000) format Null
0.4140.4750.1480.568position_empty_needle2select positionCaseInsensitive(materialize('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'), '') from numbers(100000000) format Null
0.4540.6180.3620.501uniq_with_key4SELECT uniqExact(a) FROM t_10000 group by b
0.1070.106-0.0150.442map_update3 WITH (range(100), range(100))::Map(String, UInt64) AS m1, (range(30), range(30))::Map(String, UInt64) AS m2 SELECT count() FROM numbers(50000) WHERE NOT ignore(mapUpdate(materialize(m1), m2))
0.6610.534-0.1910.383position_empty_needle1select position(materialize('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'), '', 10) from numbers(100000000) format Null
0.9920.946-0.0460.375prefetch_in_aggregation12select number from numbers_mt(1e8) group by number format Null
0.230.290.2630.368polymorphic_parts_m1INSERT INTO hits_compact(UserID) SELECT rand() FROM numbers(10000)
1.4281.50.0490.364number_formatting_formats2INSERT INTO table_Values SELECT number FROM numbers(10000000) SETTINGS engine_file_truncate_on_insert = 1
0.5060.434-0.1430.303position_empty_needle3select positionCaseInsensitive(materialize('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'), '', 10) from numbers(100000000) format Null
0.0980.120.2270.302asof2 SELECT COUNT(*) AS count FROM ( SELECT (number % 1000) AS visitor_id, number AS id FROM system.numbers LIMIT 1000000 ) AS sessions ASOF LEFT JOIN ( SELECT (number % 1000) AS visitor_id, number AS starting_session_id FROM system.numbers LIMIT 1000000 ) AS visitors ON visitors.visitor_id = sessions.visitor_id AND visitors.starting_session_id < sessions.id
0.3760.4230.1240.276position_empty_needle6select positionCaseInsensitiveUTF8(materialize('xẞyyaa1ẞ1yzẞXẞẞ1ẞẞ1bctest'), '') from numbers(100000000) format Null
0.3990.430.0780.271norm_distance5SELECT sum(dist) FROM (SELECT LinfNorm(v) AS dist FROM vecs_Float32)
0.1340.128-0.0460.263string_join2SELECT 1 FROM strings AS l ANY LEFT JOIN strings AS r USING (short) FORMAT Null
0.2090.208-0.0080.26norm_distance1SELECT sum(dist) FROM (SELECT L2Norm(v) AS dist FROM vecs_BFloat16)
0.5160.426-0.1740.241string_join1SELECT 1 FROM hits_10m_words AS l ANY LEFT JOIN hits_10m_words AS r USING (word) FORMAT Null settings join_algorithm='parallel_hash'
0.1770.174-0.0220.24insert_select_squashing_dynamic2INSERT INTO dynamic_squash_performance_1 SELECT * FROM src_dynamic_squash_performance_1
0.0280.0310.1030.238has_all8SELECT hasAll(set, subset) FROM test_table_large_Int8 FORMAT Null
0.1260.1470.160.237string_set1SELECT 1 FROM strings WHERE short IN (SELECT short FROM strings) FORMAT Null
0.1440.1450.0060.235join_used_flags0SELECT l.i64, r.i64, l.i32, r.i32 FROM test_join_used_flags l RIGHT JOIN test_join_used_flags r USING i64 format Null
0.2240.2260.0060.228general_purpose_hashes60SELECT count() from zeros(1000000) where not ignore(metroHash64(materialize('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris sollicitudin nisi ac erat mollis dapibus. Maecenas leo purus, bibendum eu erat eget, iaculis molestie tortor. Phasellus maximus odio nec mauris ultrices dictum. Morbi efficitur nisl eget congue mollis. Vestibulum pharetra diam vitae urna interdum, eget ultricies justo sollicitudin. Nunc sit amet purus id leo tempus dignissim. Donec ac lacus ut orci tempus scelerisque quis ultricies nibh. Nullam lobortis, erat ac ullamcorper interdum, odio nisl elementum quam, ut malesuada massa nunc eget quam. Nam suscipit neque quis sapien ultricies imperdiet. Maecenas augue libero, finibus tristique sagittis et, semper nec arcu. Morbi non tortor ultrices, sollicitudin justo sed, accumsan ligula. Nullam at ipsum in nibh auctor ullamcorper. Nullam laoreet neque id lorem condimentum tincidunt. Nullam vel orci nibh. Ut sit amet sem faucibus, fringilla orci at, lacin...(60)
0.1630.1990.220.226logical_functions_medium19SELECT count() FROM test_logical_functions._4_1_Nullable_Mixed WHERE NOT ignore(xor(x1,x2,x3,x4))
0.040.038-0.0620.224order_by_decimals0SELECT toInt32(number) AS n FROM numbers(10000000) ORDER BY n DESC FORMAT Null
0.0640.0760.180.222range0SELECT range(number % 100) FROM numbers(10000000) FORMAT Null

Test Performance Changes ?

TestRatio of speedup (-) or slowdown (+)QueriesTotal not OKChanged perfUnstable
Total+1.005x55846838
order_by_single_nullable-1.096x2211
string_join-1.078x4202
encodeXMLComponent-1.046x1000
lightweight_delete-1.04x1000
materialized_view_parallel_insert-1.038x1101
push_down_limit-1.029x3101
set_disable_skip_index-1.026x1000
array_fill-1.026x6101
json_type-1.023x3000
generate_table_function-1.023x10000
order_by_decimals-1.017x5101
aggregation_overflow-1.017x3000
columns_hashing-1.016x5000
group_array_moving_sum-1.016x10000
norm_distance-1.014x10505
trim_whitespace-1.012x6000
if_transform_strings_to_enum-1.012x4000
constant_column_search-1.011x10101
coalesce-1.01x1000
hashjoin_with_large_output-1.009x3000
leftpad-1.008x7000
point_in_polygon_const_3d-1.007x1000
read_hits_with_aio-1.007x4000
jit_small_requests-1.006x3000
constant_column_comparison-1.006x10000
insert_values_with_expressions-1.006x2000
parallel_mv-1.006x1000
jit_sort-1.006x10000
merge_table_streams-1.005x1000
basename-1.005x2000
number_formatting_formats-1.005x10202
concat_hits-1.005x10101
prefetch_in_aggregation-1.004x10101
logical_functions_medium-1.003x10202
general_purpose_hashes-1x10101
insert_select_squashing_dynamic+1.002x4101
round_methods+1.002x10101
optimize_sorting_for_input_stream+1.005x10000
uniq_without_key+1.005x10000
parallel_hash_build_phase+1.005x1000
trivial_insert_select_from_files+1.006x9000
join_used_flags+1.006x1101
group_array_sorted+1.007x10000
low_cardinality_insert+1.007x1000
arrow_format+1.007x3000
column_array_filter+1.008x8000
point_in_polygon_3d_huge_multipolygon+1.008x1000
empty_string_deserialization+1.009x1000
logical_functions_small+1.009x10000
int_parsing+1.009x10110
IPv6+1.009x2000
one_thousand_joins+1.01x1000
hierarchical_dictionaries+1.01x10000
IPv4+1.011x4000
prepare_hash_before_merge+1.011x4000
count_from_formats+1.012x10110
injective_functions_inside_uniq+1.012x2000
ip_trie+1.016x4000
lot_of_subcolumns+1.017x1000
lazyMaterialization+1.02x2000
dotProduct+1.022x4101
has_all+1.023x10101
removing_group_by_keys+1.024x2000
query_interpretation_join+1.024x1000
materialized_view_deduplication+1.026x1000
set_index+1.028x10220
sparse_grams+1.031x2000
dict_join+1.034x2000
position_empty_needle+1.034x8606
compact_part_subcolumns+1.037x2000
string_set+1.038x7101
distinct_combinator+1.046x4220
insert_sequential_and_background_merges+1.047x1000
uniq_with_key+1.056x7101
merge_tree_many_partitions+1.057x1110
asof+1.066x4101
merge_tree_simple_select+1.091x1000
polymorphic_parts_m+1.093x3101
range+1.098x2101
map_update+1.181x4202

Test Times ?

TestWall clock time, entire test, sTotal client time for measured query runs, sQueriesLongest query, total for measured runs, sAverage query wall clock time, sShortest query, total for measured runs, s
Total4002.4812566.06455822.0877.1731.185
lightweight_delete47.9652.01812.01847.9652.018
insert_sequential_and_background_merges34.24918.379118.37934.24918.379
lot_of_subcolumns32.6722.00212.00232.6722.002
polymorphic_parts_m84.33840.098318.75228.1133.693
order_by_single_nullable46.28838.218220.05523.14418.163
uniq_with_key161.82655.506710.95823.1186.15
one_thousand_joins22.78518.42118.4222.78518.42
avg_serialization20.79217.28117.2820.79217.28
final_big_column41.1854.24922.22920.5932.02
merge_tree_many_partitions20.2352.00812.00820.2352.008
jit_sort199.945149.561018.56419.99510.83
parallel_hash_build_phase18.08613.96113.9618.08613.96
group_array_moving_sum171.796113.4571018.31717.185.784
count_from_formats171.4820.961102.26317.1482.003
coalesce16.28813.81113.8116.28813.81
compact_part_subcolumns31.7574.24822.14515.8792.102
set_index154.19520.911102.5215.4192.004
insert_values_with_expressions30.01822.401219.14615.0093.255
number_formatting_formats137.885130.0831022.08713.7892.03
prefetch_in_aggregation137.87893.6121019.7313.7882.007
materialized_view_parallel_insert11.7318.71218.71211.7318.712
point_in_polygon_3d_huge_multipolygon11.0929.13719.13711.0929.137
position_empty_needle87.83375.538818.58710.9795.932
basename20.27616.07428.41510.1387.659
read_hits_with_aio40.15533.515418.11610.0392.058
hierarchical_dictionaries98.64184.7211015.0579.8642.012
dotProduct37.41124.99348.6849.3534.049
uniq_without_key90.86631.769107.8439.0872.035
empty_string_deserialization9.053.73413.7349.053.734
parallel_mv8.9526.6116.618.9526.61
trivial_insert_select_from_files80.51448.3797.7238.9464.383
columns_hashing42.67336.599514.6258.5352.098
right16.20613.66927.2328.1036.437
has_all80.63525.691105.2848.0642.005
distinct_combinator32.06810.01143.0848.0172.004
norm_distance78.29658.4451010.1537.833.18
int_parsing76.54156.5911010.4127.6542.012
if_string_hits30.25426.009413.1727.5642.032
set_disable_skip_index7.3082.04512.0457.3082.045
group_array_sorted71.78720.458102.1057.1792.02
trim_whitespace42.84815.67663.3467.1412.013
if_transform_strings_to_enum27.90423.79148.656.9762.247
aggregation_overflow20.79117.64537.6216.932.672
string_join27.57719.4447.2986.8942.165
base6460.98252.14911.9266.7762.055
constant_column_comparison67.74648.981107.4816.7752.082
function_calculation_after_sorting_and_limit20.28617.107312.9566.7622.038
inserts_arrays_lowcardinality12.6989.44427.2496.3492.196
ip_trie25.3598.80642.5156.342.031
general_purpose_hashes61.86153.575108.846.1862.036
uniq60.31951.46108.6926.0322.017
push_down_limit17.77715.33639.6945.9262.027
concat_hits56.46348.758109.545.6462.026
generate_table_function54.36447.0731011.0155.4362.036
uniq_with_key_dist35.90626.96774.4575.1292.873
array_fill30.44224.06969.6795.0742.079
low_cardinality_insert5.0623.93613.9365.0623.936
removing_group_by_keys9.7267.65723.9464.8633.711
leftpad33.68929.37976.3114.8132.025
insert_select_squashing_dynamic18.1613.91946.4614.542.206
string_set31.41822.83675.0354.4882.075
hashjoin_with_large_output12.3410.17533.4944.1133.238
asof16.00213.27244.742.119
merge_tree_simple_select3.8711.23211.2323.8711.232
simple_join_query15.1128.44442.1233.7782.097
logical_functions_medium37.37923.131104.2453.7382.019
uniqExactIf18.63815.48255.683.7282.009
injective_functions_inside_uniq7.3234.21522.1083.6612.107
encodeXMLComponent3.632.19312.1933.632.193
lazyMaterialization7.2325.42423.0173.6162.408
flat_dictionary35.53930.275105.5863.5542.004
async_remote_read10.4888.6234.4553.4962.061
optimize_sorting_for_input_stream33.61430.554109.3093.3612.005
insert_sparse_column3.3352.1612.163.3352.16
json_type9.9618.05133.7863.322.031
float_formatting32.87528.818105.3583.2882.028
prepare_hash_before_merge12.8418.78942.2553.212.129
optimize_window_funnel3.1762.18512.1853.1762.185
jit_small_requests9.527.79333.6613.1732.065
explain_ast3.0172.16912.1693.0172.169
join_used_flags2.9542.09412.0942.9542.094
h32.9162.14212.1422.9162.142
point_in_polygon_const_3d2.9022.09912.0992.9022.099
IPv65.7824.58422.492.8912.094
math28.5725.217104.5032.8572.011
merge_table_streams2.8312.03112.0312.8312.031
encrypt_decrypt_empty_string28.26223.007102.5622.8262.015
dict_join5.5174.19922.1792.7582.02
query_interpretation_join2.7552.04212.0422.7552.042
column_array_filter21.84518.55482.9772.7312.082
join_merge_filter_into_join2.7072.13912.1392.7072.139
orc_filter_push_down5.3914.03922.0242.6962.014
replaceRegexp_fallback10.7139.19642.6742.6782.021
arrow_format7.9786.16432.0962.6592.001
range5.2714.29922.182.6362.119
analyze_array_tuples2.5852.00912.0092.5852.009
logical_functions_small25.73522.355102.7162.5742.002
materialized_view_deduplication2.562.0112.012.562.01
sequence_match25.29421.005102.2182.5292.021
order_by_decimals12.58410.67452.2252.5172.043
writing_valid_utf87.556.27932.1412.5172.028
functions_geo15.09513.16762.6492.5162.04
map_update9.8568.2542.1772.4642.004
round_methods24.5421.769102.2422.4542.095
datetime64_conversion4.8814.09322.0732.4412.02
bigint_formatting9.6138.38942.1292.4032.052
tsv_csv_nullable_parsing4.7894.06922.042.3952.029
and_function4.7454.05722.0322.3732.025
rewrite_aggregate_if9.3028.18742.1032.3252.009
join_filter_pushdown_equivalent_sets11.45810.06252.0162.2922.009
bit_operations_fixed_string9.0368.07742.0322.2592.006
IPv49.0288.11642.0682.2572.009
count6.7455.29732.0632.2481.185
non_function_col_short_circuit8.9068.06642.0192.2272.013
arithmetic_operations_in_aggr_func13.02612.18362.0392.1712.013
joins_in_memory21.62620.325102.1112.1632.008
parse_illegal_datetime7.8667.26842.0081.9661.62
sparse_grams3.8393.31421.7491.921.565

Metric Changes ?

MetricOld median valueNew median valueRelative differenceTimes difference
MemoryShared967434242601451521.6892.689
MemoryResidentWithoutPageCache135350272015016345600.1091.109
MemoryResident135350272015016345600.1091.109
MemoryVirtual58064134144633934643200.0921.092
jemalloc.retained48476590080520294154240.0731.073
MemoryDataAndStack57003692032604587499520.0611.061
jemalloc.arenas.all.dirty_purged166398181156355444-0.061.064
TotalRowsOfMergeTreeTablesSystem267995237716-0.1131.127
MaxPartCountForPartition87-0.1251.143
KeeperOpenFileDescriptorCount157133-0.1531.18