数据库:zhcxkj_center_strategy_comprehensive
查询时间:25.3764
执行次数: 162
扫描行数:194214
发送行数:1
指纹SQL: SELECT COUNT ( * ) FROM ? WHERE ( source_id = ? AND status = ? AND create_time >= ? ) ;
真实SQL:SELECT COUNT( * ) FROM t_strategy_execute_queue_offline_fruugo WHERE (source_id = 27738 AND status = 4 AND create_time >= 2025-10-15 00:00:00);
袁慧斌,人工修改过
AISQL修改建议:SELECT COUNT(*)
FROM t_strategy_execute_queue_offline_fruugo
WHERE source_id = 27738
AND status = 4
AND create_time >= 2025-10-15 00:00:00;
explain表:
| id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | SIMPLE | t_strategy_execute_queue_offline_fruugo | None | range | idx_source_id,idx_source_id_status,idx_create_time_status | idx_create_time_status | 19 | None | 591140 | 0.74 | Using where; Using index |
额外建议:排查索引
索引建议:
取出表 【t_strategy_execute_queue_offline_fruugo】 where条件字段 【source_id】 100000 条记录,重复的数据有:【100000】 条,没有必要为该字段创建索引。
取出表 【t_strategy_execute_queue_offline_fruugo】 where条件字段 【status】 100000 条记录,重复的数据有:【94222】 条,没有必要为该字段创建索引。
→ 【t_strategy_execute_queue_offline_fruugo】表 【create_time】字段,索引已经存在,无需添加任何索引。
【t_strategy_execute_queue_offline_fruugo】表 【create_time】字段,索引分析:
+--------------------------------+------------------------+---------------+---------------+
| TABLE_NAME | INDEX_NAME | COLUMN_NAME | CARDINALITY |
+================================+========================+===============+===============+
| t_strategy_execute_queue_offli | idx_create_time_status | create_time | 260586 |
| ne_fruugo | | | |
+--------------------------------+------------------------+---------------+---------------+
已解决