【资源配置】
【附件:截图/日志/监控】
线上v5.4.1 走tiflash 查询有distinct非常慢,也设置了set @
@tidb_opt_distinct_agg_push_down
= 1; 但是效果也是非常慢,去掉distinct就很快,求如何在优化?
SELECT * FROM (select login_date,sum(login_cnt) as login_cnt,count(distinct id) as active_user from log_login_1051 where login_date >= ‘2022-11-29’ AND login_date <= ‘2022-12-28’ group by login_date) tmp ORDER BY login_date ASC LIMIT 1000 OFFSET 0;
MySQL [xxx]> select count(1) from log_login_1051;
±----------+
| count(1) |
±----------+
| 242504116 |
±----------+
1 row in set (0.67 sec)