数据库:zhcxkj_center_datasync_comprehensive
查询时间:22.6599
执行次数: 24
扫描行数:344292
发送行数:344292
指纹SQL: SELECT * FROM ? . t_walmart_sku_shipping_template_us WHERE update_time >= ? AND update_time < ? ;
真实SQL:SELECT * FROM zhcxkj_center_datasync_comprehensive.t_walmart_sku_shipping_template_us WHERE update_time >= 2025-11-02 10:19:58 AND update_time < 2025-11-02 10:20:58;
无人工修改
AISQL修改建议:SELECT id, sku, shipping_template, region, shipping_type, cost, update_time
FROM zhcxkj_center_datasync_comprehensive.t_walmart_sku_shipping_template_us
WHERE update_time >= 2025-11-02 10:19:58
AND update_time < 2025-11-02 10:20:58;
**优化说明:**
1. 将SELECT *替换为具体字段名,减少不必要的数据传输
2. 建议在update_time字段上建立索引:CREATE INDEX idx_update_time ON t_walmart_sku_shipping_template_us(update_time)
3. 时间范围查询已使用高效的区间查询方式(>=和<)
explain表:
| id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | SIMPLE | t_walmart_sku_shipping_template_us | None | range | idx_update_time | idx_update_time | 5 | None | 392140 | 100 | Using index condition |
额外建议:
索引建议:
→ 【t_walmart_sku_shipping_template_us】表 【update_time】字段,索引已经存在,无需添加任何索引。
【t_walmart_sku_shipping_template_us】表 【update_time】字段,索引分析:
+--------------------------------+--------------------------------+---------------+---------------+
| TABLE_NAME | INDEX_NAME | COLUMN_NAME | CARDINALITY |
+================================+================================+===============+===============+
| t_walmart_sku_shipping_templat | idx_sourceid_updatetime_isdele | update_time | 8738924 |
| e_us | ted_id | | |
+--------------------------------+--------------------------------+---------------+---------------+
| t_walmart_sku_shipping_templat | idx_update_time | update_time | 1071982 |
| e_us | | | |
+--------------------------------+--------------------------------+---------------+---------------+
同步任务去掉*号,加字段