StarRocks / starrocks

The world's fastest open query engine for sub-second analytics both on and off the data lakehouse. With the flexibility to support nearly any scenario, StarRocks provides best-in-class performance for multi-dimensional analytics, real-time analytics, and ad-hoc queries. A Linux Foundation project.
https://starrocks.io
Apache License 2.0
9.06k stars 1.82k forks source link

[Enhancement] add limit operator before union gather (backport #53102) #53121

Closed mergify[bot] closed 13 hours ago

mergify[bot] commented 13 hours ago

Why I'm doing:

baseline:

mysql>   select  to_bitmap(1) FROM TABLE(generate_series(0, 655350)) union all select bitmap_agg(lo_orderkey) from lineorder group by lo_linenumber limit 1;
+--------------+
| to_bitmap(1) |
+--------------+
| NULL         |
+--------------+
1 row in set (7.42 sec)

patched:

mysql> select  to_bitmap(1) FROM TABLE(generate_series(0, 655350)) union all select bitmap_agg(lo_orderkey) from lineorder group by lo_linenumber limit 1;
+--------------+
| to_bitmap(1) |
+--------------+
| NULL         |
+--------------+
1 row in set (0.04 sec)

What I'm doing:

Fixes #issue

What type of PR is this:

Does this PR entail a change in behavior?

If yes, please specify the type of change:

Checklist:

Bugfix cherry-pick branch check:

What I'm doing:

Fixes #issue

What type of PR is this:

Does this PR entail a change in behavior?

If yes, please specify the type of change:

Checklist: