[improvement](bitmap) Using set to store a small number of elements to improve performance (#19973)
Test on SSB 100g: select lo_suppkey, count(distinct lo_linenumber) from lineorder group by lo_suppkey; exec time: 4.388s create materialized view: create materialized view customer_uv as select lo_suppkey, bitmap_union(to_bitmap(lo_linenumber)) from lineorder group by lo_suppkey; select lo_suppkey, count(distinct lo_linenumber) from lineorder group by lo_suppkey; exec time: 12.908s test with the patch, exec time: 5.790s
This commit is contained in:
@ -127,14 +127,12 @@ struct ToBitmap {
|
||||
size_t size = col->size();
|
||||
|
||||
for (size_t i = 0; i < size; ++i) {
|
||||
if (arg_is_nullable && ((*nullmap)[i])) {
|
||||
continue;
|
||||
} else {
|
||||
int64_t int_value = col->get_data()[i];
|
||||
if (LIKELY(int_value >= 0)) {
|
||||
res_data[i].add(int_value);
|
||||
if constexpr (arg_is_nullable) {
|
||||
if ((*nullmap)[i]) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
res_data[i].add(col->get_data()[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user