版本:2.0.2
左表按照文档上设置成了单分区,而且连表条件得date(date)、hour(int)、pchannel(varchar50)是左表得分桶列,但是看查询计划使用得是shuffle,而不是bucket_shuffle
explain SELECT date AS date, round(IFNULL(SUM( cost),0),2) AS cost FROM ad_hour_indicator_new left JOIN adserving_bi_conversion_indicator_new_hi ON date = dt AND ad_hour_indicator_new.hour = adserving_bi_conversion_indicator_new_hi.hour AND ad_hour_indicator_new.pchannel = adserving_bi_conversion_indicator_new_hi.pchannel WHERE date >= '2024-09-10' AND date <= '2024-10-1' GROUP BY date ORDER BY date;
而加上HINT '[shuffle]'才能使用bucket_shuffle,比较奇怪还有什么因素可以影响到这个,左表总数大概100w+,右表几十万
explain SELECT date AS date, round(IFNULL(SUM( cost),0),2) AS cost FROM ad_hour_indicator_new left JOIN[shuffle] adserving_bi_conversion_indicator_new_hi ON date = dt AND ad_hour_indicator_new.hour = adserving_bi_conversion_indicator_new_hi.hour AND ad_hour_indicator_new.pchannel = adserving_bi_conversion_indicator_new_hi.pchannel WHERE date >= '2024-09-10' AND date <= '2024-10-1' GROUP BY date ORDER BY date;