【详述】
sql 1:不使用 grouping sets ,对单一字段进行group by操作
– 1 并行度 1m38s
– 16 并行度 1m40s
SELECT
#days
, count(#distinct_id
) as cnt
, count(distinct #distinct_id
) as d_cnt
from ruixue_bigdata_test.dwd_fact_event_login_tst100yi
group by #days
;
1并行度和16并行度的查询时长差不多。
sql 2:不使用 grouping sets ,对单一字段进行group by操作
– 1 并行度 1m34s
– 16 并行度 1m39s
SELECT
#days
, reg_appid
, count(#distinct_id
) as cnt
, count(distinct #distinct_id
) as d_cnt
from ruixue_bigdata_test.dwd_fact_event_login_tst100yi
group by #days
, reg_appid
;
1并行度和16并行度的查询时长差不多。
sql3:使用grouping sets
– 1 并行度 4m23s
– 16 并行度 4m32s
SELECT
#days
, reg_appid
, count(#distinct_id
) as cnt
, count(distinct #distinct_id
) as d_cnt
from ruixue_bigdata_test.dwd_fact_event_login_tst100yi
group by grouping sets((#days
),(#days
, reg_appid))
;
1并行度和16并行度的查询时长差不多,但是远大于sql 1 + sql 2的时长。
dwd_fact_event_login_tst100yi 单表数据量是15亿,目前不清楚为什么grouping sets的性能差。
【StarRocks版本】2.4.0
【集群规模】3fe + 5be