Search before asking
Description
- two table A and B, B is a bitmap table;
> desc A;
+------------------+-------------+------+-------+---------+---------+
| Field | Type | Null | Key | Default | Extra |
+------------------+-------------+------+-------+---------+---------+
| id | BIGINT | Yes | true | NULL | |
| name | VARCHAR(50) | Yes | false | NULL | REPLACE |
+------------------+-------------+------+-------+---------+---------+
> desc B;
+------------+--------+------+-------+---------+--------------+
| Field | Type | Null | Key | Default | Extra |
+------------+--------+------+-------+---------+--------------+
| key | BIGINT | Yes | true | NULL | |
| ids | BITMAP | Yes | false | | BITMAP_UNION |
+------------+--------+------+-------+---------+--------------+
-
make some test data, for example bitmap_count(B.ids)=10W
-
try to query with explode_bitmap, it is very slow (1m12s) for 10W bitmap:
select name, count(*) as num from A where id in (select bc from B lateral view explode_bitmap(ids) tmp_v as bc where key=100000) group by name order by num desc limit 10;
-
after profile, I find explode_bitmap return lots of data, make it very slow
Solution
avoid unused columns copy in table function node
Are you willing to submit PR?
Code of Conduct
Search before asking
Description
make some test data, for example bitmap_count(B.ids)=10W
try to query with explode_bitmap, it is very slow (1m12s) for 10W bitmap:
select name, count(*) as num from A where id in (select bc from B lateral view explode_bitmap(ids) tmp_v as bc where key=100000) group by name order by num desc limit 10;after profile, I find explode_bitmap return lots of data, make it very slow
Solution
avoid unused columns copy in table function node
Are you willing to submit PR?
Code of Conduct