mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
Apply preallocation optimisation more carefully (#44455)
* impl * add perf test * fix * review fixes
This commit is contained in:
parent
857799fbca
commit
006fdd32d4
@ -233,7 +233,8 @@ void initDataVariantsWithSizeHint(
|
||||
stats_collecting_params.max_size_to_preallocate_for_aggregation,
|
||||
hint->median_size * max_threads);
|
||||
}
|
||||
else
|
||||
/// https://github.com/ClickHouse/ClickHouse/issues/44402#issuecomment-1359920703
|
||||
else if ((max_threads > 1 && hint->sum_of_sizes > 100'000) || hint->sum_of_sizes > 500'000)
|
||||
{
|
||||
const auto adjusted = std::max(lower_limit, hint->median_size);
|
||||
if (worthConvertToTwoLevel(
|
||||
|
30
tests/performance/hash_table_sizes_stats_small.xml
Normal file
30
tests/performance/hash_table_sizes_stats_small.xml
Normal file
@ -0,0 +1,30 @@
|
||||
<test>
|
||||
<settings>
|
||||
<collect_hash_table_stats_during_aggregation>1</collect_hash_table_stats_during_aggregation>
|
||||
</settings>
|
||||
|
||||
<substitutions>
|
||||
<substitution>
|
||||
<name>size</name>
|
||||
<values>
|
||||
<value>100000</value>
|
||||
<value>200000</value>
|
||||
<value>300000</value>
|
||||
<value>400000</value>
|
||||
<value>500000</value>
|
||||
<value>600000</value>
|
||||
<value>700000</value>
|
||||
<value>800000</value>
|
||||
<value>900000</value>
|
||||
<value>1000000</value>
|
||||
<value>1500000</value>
|
||||
<value>2000000</value>
|
||||
<value>2500000</value>
|
||||
<value>3000000</value>
|
||||
</values>
|
||||
</substitution>
|
||||
</substitutions>
|
||||
|
||||
<query>select number from numbers({size}) group by number format Null</query>
|
||||
<query>select number from numbers_mt({size}) group by number format Null</query>
|
||||
</test>
|
@ -11,7 +11,7 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
|
||||
|
||||
# tests rely on that all the rows are unique and max_threads divides table_size
|
||||
table_size=10000
|
||||
table_size=1000005
|
||||
max_threads=5
|
||||
|
||||
|
||||
|
@ -13,7 +13,7 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
|
||||
|
||||
# tests rely on that all the rows are unique and max_threads divides table_size
|
||||
table_size=10000
|
||||
table_size=1000005
|
||||
max_threads=5
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user