重现步骤
反馈人:袁慧斌
数据库:zhcxkj_center_strategy_comprehensive
查询时间:10.9493
执行次数: 34
扫描行数:68265.4
发送行数:877.5
指纹SQL: SELECT id , retry_status , source_id , country_code FROM ? WHERE ( source_id = ? AND status = ? ) limit ? ;
真实SQL:SELECT id,retry_status,source_id,country_code FROM t_strategy_execute_queue_edit_ozon WHERE (source_id = 25655 AND status = 0) limit 1000;
无人工修改
AISQL修改建议: 优化后的SQL语句


SELECT id, retry_status, source_id, country_code
FROM t_strategy_execute_queue_edit_ozon
WHERE source_id = 25655 AND status = 0
LIMIT 1000;


优化建议

1. 去除了不必要的括号,虽然对性能影响很小,但使SQL更简洁
2. 最重要的是,建议在表上创建复合索引:(source_id, status)
3. 如果经常查询这4个字段,可以考虑创建一个覆盖索引:(source_id, status, id, retry_status, country_code)

创建索引的SQL(如果需要)


ALTER TABLE t_strategy_execute_queue_edit_ozon ADD INDEX idx_source_status (source_id, status);
-- 或者创建覆盖索引
ALTER TABLE t_strategy_execute_queue_edit_ozon ADD INDEX idx_covering (source_id, status, id, retry_status, country_code);
explain表:






id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t_strategy_execute_queue_edit_ozon None ref idx_source_id,idx_status idx_status 5 const 75 0.94 Using where

额外建议:
索引建议:

历史记录  
  1. 2025-10-09 10:06:03, 由 陈莉珍 创建。
  2. 2025-10-09 11:31:47, 由 周凯 解决,方案为 系统设计缺陷 。
    修改了 解决方案,旧值为 "",新值为 "bydesign"。
    修改了 解决日期,旧值为 "",新值为 "2025-10-09 11:31:32"。
    修改了 指派给 ,旧值为 "zhoukai",新值为 "chenlizhen"。
    修改了 Bug状态 ,旧值为 "active",新值为 "resolved"。
    修改了 是否确认,旧值为 "0",新值为 "1"。
    修改了 解决者 ,旧值为 "",新值为 "zhoukai"。
  3. 2025-10-10 10:34:20, 由 陈莉珍 编辑。
    修改了 所属模块 ,旧值为 "0",新值为 "1953"。
    修改了 业务部门 ,旧值为 "0",新值为 "2"。
    修改了 测试责任人,旧值为 "",新值为 "zhoukai"。
    修改了 解决时效 ,旧值为 "0",新值为 "1.42"。
    修改了 重现步骤 ,区别为:
    001- 反馈人:袁慧斌
    001+ 反馈人:袁慧斌 数据库:zhcxkj_center_strategy_comprehensive 查询时间:10.9493 执行次数: 34 扫描行数:68265.4 发送行数:877.5 指纹SQL: SELECT id , retry_status , source_id , country_code FROM ? WHERE ( source_id = ? AND status = ? ) limit ? ; 真实SQL:SELECT id,retry_status,source_id,country_code FROM t_strategy_execute_queue_edit_ozon WHERE (source_id = 25655 AND status = 0) limit 1000; 无人工修改 AISQL修改建议: 优化后的SQL语句 SELECT id, retry_status, source_id, country_code FROM t_strategy_execute_queue_edit_ozon WHERE source_id = 25655 AND status = 0 LIMIT 1000; 优化建议 1. 去除了不必要的括号,虽然对性能影响很小,但使SQL更简洁 2. 最重要的是,建议在表上创建复合索引:(source_id, status) 3. 如果经常查询这4个字段,可以考虑创建一个覆盖索引:(source_id, status, id, retry_status, country_code) 创建索引的SQL(如果需要) ALTER TABLE t_strategy_execute_queue_edit_ozon ADD INDEX idx_source_status (source_id, status); -- 或者创建覆盖索引 ALTER TABLE t_strategy_execute_queue_edit_ozon ADD INDEX idx_covering (source_id, status, id, retry_status, country_code); explain表:id
    002- 数据库:zhcxkj_center_strategy_comprehensive
    002+ select_type
    003- 查询时间:10.9493
    003+ table
    004- 执行次数: 34
    004+ partitions
    005- 扫描行数:68265.4
    005+ type
    006- 发送行数:877.5
    006+ possible_keys
    007- 指纹SQL: SELECT id , retry_status , source_id , country_code FROM ? WHERE ( source_id = ? AND status = ? ) limit ? ;
    007+ key
    008- 真实SQL:SELECT id,retry_status,source_id,country_code FROM t_strategy_execute_queue_edit_ozon WHERE (source_id = 25655 AND status = 0) limit 1000;
    008+ key_len
    009- 无人工修改
    009+ ref
    010- AISQL修改建议: 优化后的SQL语句
    010+ rows
    011-
    011+ filtered
    012-
    012+ Extra
    013- SELECT id, retry_status, source_id, country_code
    013+ 1
    014- FROM t_strategy_execute_queue_edit_ozon
    014+ SIMPLE
    015- WHERE source_id = 25655 AND status = 0
    015+ t_strategy_execute_queue_edit_ozon
    016- LIMIT 1000;
    016+ None
    017-
    017+ ref
    018-
    018+ idx_source_id,idx_status
    019- 优化建议
    019+ idx_status
    020-
    020+ 5
    021- 1. 去除了不必要的括号,虽然对性能影响很小,但使SQL更简洁
    021+ const
    022- 2. 最重要的是,建议在表上创建复合索引:(source_id, status)
    022+ 75
    023- 3. 如果经常查询这4个字段,可以考虑创建一个覆盖索引:(source_id, status, id, retry_status, country_code)
    023+ 0.94
    024-
    024+ Using where
    025- 创建索引的SQL(如果需要)
    025+
    026-
    026+ 额外建议: 索引建议:
    027-
    028- ALTER TABLE t_strategy_execute_queue_edit_ozon ADD INDEX idx_source_status (source_id, status);
    029- -- 或者创建覆盖索引
    030- ALTER TABLE t_strategy_execute_queue_edit_ozon ADD INDEX idx_covering (source_id, status, id, retry_status, country_code);
    031- explain表:
    032-
    033-
    034-
    035-
    036-
    037-
    038-
    039-
    040-
    041-
    042- id
    043-
    044-
    045- select_type
    046-
    047-
    048- table
    049-
    050-
    051- partitions
    052-
    053-
    054- type
    055-
    056-
    057- possible_keys
    058-
    059-
    060- key
    061-
    062-
    063- key_len
    064-
    065-
    066- ref
    067-
    068-
    069- rows
    070-
    071-
    072- filtered
    073-
    074-
    075- Extra
    076-
    077-
    078-
    079-
    080-
    081-
    082- 1
    083-
    084-
    085- SIMPLE
    086-
    087-
    088- t_strategy_execute_queue_edit_ozon
    089-
    090-
    091- None
    092-
    093-
    094- ref
    095-
    096-
    097- idx_source_id,idx_status
    098-
    099-
    100- idx_status
    101-
    102-
    103- 5
    104-
    105-
    106- const
    107-
    108-
    109- 75
    110-
    111-
    112- 0.94
    113-
    114-
    115- Using where
    116-
    117-
    118-
    119-
    120-
    121- 额外建议:
    122- 索引建议:
    123-
    001- 反馈人:袁慧斌<br />
    001+ 反馈人:袁慧斌<br /> 数据库:zhcxkj_center_strategy_comprehensive<br /> 查询时间:10.9493<br /> 执行次数: 34<br /> 扫描行数:68265.4<br /> 发送行数:877.5<br /> 指纹SQL: SELECT id , retry_status , source_id , country_code FROM ? WHERE ( source_id = ? AND status = ? ) limit ? ;<br /> 真实SQL:SELECT id,retry_status,source_id,country_code FROM t_strategy_execute_queue_edit_ozon WHERE (source_id = 25655 AND status = 0) limit 1000;<br /> 无人工修改<br /> AISQL修改建议: 优化后的SQL语句<br /><br /><br /> SELECT id, retry_status, source_id, country_code<br /> FROM t_strategy_execute_queue_edit_ozon<br /> WHERE source_id = 25655 AND status = 0<br /> LIMIT 1000;<br /><br /><br /> 优化建议<br /><br /> 1. 去除了不必要的括号,虽然对性能影响很小,但使SQL更简洁<br /> 2. 最重要的是,建议在表上创建复合索引:(source_id, status)<br /> 3. 如果经常查询这4个字段,可以考虑创建一个覆盖索引:(source_id, status, id, retry_status, country_code)<br /><br /> 创建索引的SQL(如果需要)<br /><br /><br /> ALTER TABLE t_strategy_execute_queue_edit_ozon ADD INDEX idx_source_status (source_id, status);<br /> -- 或者创建覆盖索引<br /> ALTER TABLE t_strategy_execute_queue_edit_ozon ADD INDEX idx_covering (source_id, status, id, retry_status, country_code);<br /> explain表:<br /><br /><br /><br /><br /><br /><br /><table><tbody><tr><th>id</th>
    002- 数据库:zhcxkj_center_strategy_comprehensive<br />
    002+ <th>select_type</th>
    003- 查询时间:10.9493<br />
    003+ <th>table</th>
    004- 执行次数: 34<br />
    004+ <th>partitions</th>
    005- 扫描行数:68265.4<br />
    005+ <th>type</th>
    006- 发送行数:877.5<br />
    006+ <th>possible_keys</th>
    007- 指纹SQL: SELECT id , retry_status , source_id , country_code FROM ? WHERE ( source_id = ? AND status = ? ) limit ? ;<br />
    007+ <th>key</th>
    008- 真实SQL:SELECT id,retry_status,source_id,country_code FROM t_strategy_execute_queue_edit_ozon WHERE (source_id = 25655 AND status = 0) limit 1000;<br />
    008+ <th>key_len</th>
    009- 无人工修改<br />
    009+ <th>ref</th>
    010- AISQL修改建议: 优化后的SQL语句<br />
    010+ <th>rows</th>
    011- <br />
    011+ <th>filtered</th>
    012- <br />
    012+ <th>Extra</th>
    013- SELECT id, retry_status, source_id, country_code<br />
    013+ </tr></tbody><tbody><tr><td>1</td>
    014- FROM t_strategy_execute_queue_edit_ozon<br />
    014+ <td>SIMPLE</td>
    015- WHERE source_id = 25655 AND status = 0<br />
    015+ <td>t_strategy_execute_queue_edit_ozon</td>
    016- LIMIT 1000;<br />
    016+ <td>None</td>
    017- <br />
    017+ <td>ref</td>
    018- <br />
    018+ <td>idx_source_id,idx_status</td>
    019- 优化建议<br />
    019+ <td>idx_status</td>
    020- <br />
    020+ <td>5</td>
    021- 1. 去除了不必要的括号,虽然对性能影响很小,但使SQL更简洁<br />
    021+ <td>const</td>
    022- 2. 最重要的是,建议在表上创建复合索引:(source_id, status)<br />
    022+ <td>75</td>
    023- 3. 如果经常查询这4个字段,可以考虑创建一个覆盖索引:(source_id, status, id, retry_status, country_code)<br />
    023+ <td>0.94</td>
    024- <br />
    024+ <td>Using where</td>
    025- 创建索引的SQL(如果需要)<br />
    025+ </tr></tbody></table><br />
    026- <br />
    026+ 额外建议:<br /> 索引建议:<br /><br />
    027- <br />
    028- ALTER TABLE t_strategy_execute_queue_edit_ozon ADD INDEX idx_source_status (source_id, status);<br />
    029- -- 或者创建覆盖索引<br />
    030- ALTER TABLE t_strategy_execute_queue_edit_ozon ADD INDEX idx_covering (source_id, status, id, retry_status, country_code);<br />
    031- explain表:<br />
    032- <br />
    033- <br />
    034- <br />
    035- <br />
    036- <br />
    037- <br />
    038- <table>
    039- <tbody>
    040- <tr>
    041- <th>
    042- id
    043- </th>
    044- <th>
    045- select_type
    046- </th>
    047- <th>
    048- table
    049- </th>
    050- <th>
    051- partitions
    052- </th>
    053- <th>
    054- type
    055- </th>
    056- <th>
    057- possible_keys
    058- </th>
    059- <th>
    060- key
    061- </th>
    062- <th>
    063- key_len
    064- </th>
    065- <th>
    066- ref
    067- </th>
    068- <th>
    069- rows
    070- </th>
    071- <th>
    072- filtered
    073- </th>
    074- <th>
    075- Extra
    076- </th>
    077- </tr>
    078- </tbody>
    079- <tbody>
    080- <tr>
    081- <td>
    082- 1
    083- </td>
    084- <td>
    085- SIMPLE
    086- </td>
    087- <td>
    088- t_strategy_execute_queue_edit_ozon
    089- </td>
    090- <td>
    091- None
    092- </td>
    093- <td>
    094- ref
    095- </td>
    096- <td>
    097- idx_source_id,idx_status
    098- </td>
    099- <td>
    100- idx_status
    101- </td>
    102- <td>
    103- 5
    104- </td>
    105- <td>
    106- const
    107- </td>
    108- <td>
    109- 75
    110- </td>
    111- <td>
    112- 0.94
    113- </td>
    114- <td>
    115- Using where
    116- </td>
    117- </tr>
    118- </tbody>
    119- </table>
    120- <br />
    121- 额外建议:<br />
    122- 索引建议:<br />
    123- <br />
  4. 2025-10-10 10:34:22, 由 陈莉珍 关闭。
    修改了 Bug状态 ,旧值为 "resolved",新值为 "closed"。
    修改了 指派给 ,旧值为 "chenlizhen",新值为 "closed"。
    修改了 由谁关闭,旧值为 "",新值为 "chenlizhen"。
    修改了 关闭日期,旧值为 "",新值为 "2025-10-10 10:34:22"。
所属项目 技术中心-需求池
所属模块 多平台   OZON
所属计划
所属迭代
Bug类型
严重程度 一般
优先级 P1
Bug状态 已关闭
业务部门 总经办
影响功能
开发责任人 周凯
测试责任人 周凯
解决时效 1.42
激活次数 0
激活日期
是否确认 是
当前指派 Closed 于 2025-10-10 10:34:22
截止日期 0000-00-00
上线时间 2025-10-09 11:31:32
上线时效 1.42
操作系统
浏览器
关键词
抄送给
所属迭代
相关需求
相关任务
由谁创建 陈莉珍 于 2025-10-09 10:06:03
影响环境 生产环境-业务反馈
由谁解决 周凯 于 2025-10-09 11:31:32
解决版本
解决方案 系统设计缺陷
由谁关闭 陈莉珍 于 2025-10-10 10:34:22
最后修改 陈莉珍 于 2025-10-10 10:34:22
相关Bug