zbtzbtzbt opened a new issue #7008: URL: https://github.com/apache/incubator-doris/issues/7008
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/incubator-doris/issues?q=is%3Aissue) and found no similar issues. ### Version master ### What's Wrong? 简单的说就是在bitmap_union_count中加了if判断后,rollup就命中不了了,导致查询很慢;不加可以命中。 ### What You Expected? 在bitmap_union_count里使用IF也可以命中rollup(详情见下面的 step 3.1) ### How to Reproduce? 复现流程如下: - step1:建表、建rollup ``` CREATE TABLE table_1 ( k1 int NULL, k2 int NULL, k3 int NULL, v1 bitmap BITMAP_UNION NULL ) AGGREGATE KEY(k1,k2,k3) DISTRIBUTED BY HASH(k1) BUCKETS 10 rollup (rollup_1(k1,k2,v1)) PROPERTIES("replication_num" = "1"); ``` - step2:插入数据 ``` insert into table_1 select 1 as k1, 2 as k2, 3 as k3, to_bitmap(10) as v1; insert into table_1 select 2 as k1, 2 as k2, 3 as k3, to_bitmap(10) as v1; ``` - step3.1:bitmap_union_count里使用IF,则无法命中rollup ``` EXPLAIN SELECT k1, bitmap_union_count(IF(k2=0,v1,NULL)) AS v1_num FROM table_1 GROUP BY k1; -- result: PREAGGREGATION: OFF. rollup: table_1 ``` - step3.2:bitmap_union_count里不使用IF,则可以命中rollup ``` EXPLAIN SELECT k1, bitmap_union_count(v1) AS v1_num FROM table_1 GROUP BY k1; -- result: PREAGGREGATION: ON rollup: rollup_1 ``` ### Anything Else? 无 ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org