mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
Vectorize filter generation of ColumnNullable in FilterDescription (#45962)
This commit achieved the data parallelism for filter generations of the nullable columns by replacing the logical AND operator with the bitwise one, which could be auto-vectorized by the compiler.
This commit is contained in:
parent
52d4e78b7f
commit
b43ffb98e8
@ -82,7 +82,12 @@ FilterDescription::FilterDescription(const IColumn & column_)
|
||||
const auto size = res.size();
|
||||
assert(size == null_map.size());
|
||||
for (size_t i = 0; i < size; ++i)
|
||||
res[i] = res[i] && !null_map[i];
|
||||
{
|
||||
auto has_val = static_cast<UInt8>(!!res[i]);
|
||||
auto not_null = static_cast<UInt8>(!null_map[i]);
|
||||
/// Instead of the logical AND operator(&&), the bitwise one(&) is utilized for the auto vectorization.
|
||||
res[i] = has_val & not_null;
|
||||
}
|
||||
|
||||
data = &res;
|
||||
data_holder = std::move(mutable_holder);
|
||||
|
Loading…
Reference in New Issue
Block a user