mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
enable used flags's reinit only when the hash talbe rehash
This commit is contained in:
parent
8adc878049
commit
a07359fbe8
@ -79,7 +79,13 @@ namespace JoinStuff
|
||||
{
|
||||
assert(flags[nullptr].size() <= size);
|
||||
need_flags = true;
|
||||
flags[nullptr] = std::vector<std::atomic_bool>(size);
|
||||
// For one disjunct clause case, we don't need to reinit each time we call addJoinedBlock.
|
||||
// and there is no value inserted in this JoinUsedFlags before addJoinedBlock finish.
|
||||
// So we reinit only when the hash table is rehashed to a larger size.
|
||||
if (flags.empty() || flags[nullptr].size() < size) [[unlikely]]
|
||||
{
|
||||
flags[nullptr] = std::vector<std::atomic_bool>(size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
6
tests/performance/join_used_flags.xml
Normal file
6
tests/performance/join_used_flags.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<test>
|
||||
<create_query>CREATE TABLE test_join_used_flags (i64 Int64, i32 Int32) ENGINE = Memory</create_query>
|
||||
<fill_query>INSERT INTO test_join_used_flags SELECT number AS i64, rand32() AS i32 FROM numbers(20000000)</fill_query>
|
||||
<query>SELECT 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</query>
|
||||
<drop_query>DROP TABLE IF EXISTS test_join_used_flags</drop_query>
|
||||
</test>
|
Loading…
Reference in New Issue
Block a user