We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently, count(distinct) in MPP mode still execute in a single worker, which is bad when there are large number of distinct values. e.g.:
mysql> explain select count(distinct L_ORDERKEY) from lineitem; +------------------------------------+----------+--------------+----------------+-----------------------------------------------------------+ | id | estRows | task | access object | operator info | +------------------------------------+----------+--------------+----------------+-----------------------------------------------------------+ | TableReader_18 | 1.00 | root | | data:ExchangeSender_17 | | └─ExchangeSender_17 | 1.00 | mpp[tiflash] | | ExchangeType: PassThrough | | └─Projection_13 | 1.00 | mpp[tiflash] | | Column#18 | | └─HashAgg_14 | 1.00 | mpp[tiflash] | | funcs:count(distinct test.lineitem.l_orderkey)->Column#18 | | └─ExchangeReceiver_16 | 1.00 | mpp[tiflash] | | | | └─ExchangeSender_15 | 1.00 | mpp[tiflash] | | ExchangeType: PassThrough | | └─HashAgg_6 | 1.00 | mpp[tiflash] | | group by:test.lineitem.l_orderkey, | | └─TableFullScan_12 | 10000.00 | mpp[tiflash] | table:lineitem | keep order:false, stats:pseudo | +------------------------------------+----------+--------------+----------------+-----------------------------------------------------------+ 8 rows in set (0.01 sec)
We should be able to generate a plan with 3 stage aggregation for scalar distinct agg. NB. only for cases where there is only 1 distinct agg function.
The text was updated successfully, but these errors were encountered:
planner: support 3 stage aggregation for single scalar distinct agg (#…
efc0720
…37203) close #37202
Successfully merging a pull request may close this issue.
Enhancement
Currently, count(distinct) in MPP mode still execute in a single worker, which is bad when there are large number of distinct values. e.g.:
We should be able to generate a plan with 3 stage aggregation for scalar distinct agg.
NB. only for cases where there is only 1 distinct agg function.
The text was updated successfully, but these errors were encountered: