重现步骤
反馈人:王凯
数据库:zhcxkj_center_strategy_comprehensive
查询时间:89.7529
执行次数: 86
扫描行数:1496920
发送行数:463.849
指纹SQL: SELECT id , retry_status , source_id FROM ? WHERE ( source_id = ? AND status = ? ) limit ? ;
真实SQL:SELECT id,retry_status,source_id FROM t_strategy_execute_queue_picture_ozon WHERE (source_id = 25665 AND status = 0) limit 1000;
王凯,人工修改过
AISQL修改建议: 优化后的SQL语句


SELECT id, retry_status, source_id
FROM t_strategy_execute_queue_picture_ozon
WHERE source_id = 25665 AND status = 0
LIMIT 1000;


优化说明:
1. 移除了不必要的括号,简化了查询结构
2. 为了进一步提升性能,建议在 source_id 和 status 字段上创建复合索引:

CREATE INDEX idx_source_status ON t_strategy_execute_queue_picture_ozon(source_id, status);
explain表:






id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t_strategy_execute_queue_picture_ozon None ALL None None None None 3004977 1 Using where

额外建议:
索引建议:
取出表 【t_strategy_execute_queue_picture_ozon】 where条件字段 【status】 100000 条记录,重复的数据有:【51918】 条。

建议添加索引:CREATE INDEX idx_source_status ON t_strategy_execute_queue_picture_ozon(source_id, status);


【t_strategy_execute_queue_picture_ozon】表 【source_id】字段,索引分析:
+--------------+--------------+---------------+---------------+
| TABLE_NAME | INDEX_NAME | COLUMN_NAME | CARDINALITY |
+==============+==============+===============+===============+
+--------------+--------------+---------------+---------------+


历史记录  
  1. 2025-09-01 15:42:35, 由 李乐同 创建。
  2. 2025-09-02 19:43:56, 由 蔡俊伟 解决,方案为 性能问题 。
    修改了 解决方案,旧值为 "",新值为 "performance"。
    修改了 解决版本,旧值为 "",新值为 "trunk"。
    修改了 解决日期,旧值为 "",新值为 "2025-09-02 19:43:43"。
    修改了 指派给 ,旧值为 "caijunwei",新值为 "liletong"。
    修改了 Bug状态 ,旧值为 "active",新值为 "resolved"。
    修改了 是否确认,旧值为 "0",新值为 "1"。
    修改了 解决者 ,旧值为 "",新值为 "caijunwei"。

    已解决

  3. 2025-09-02 19:46:55, 由 李乐同 编辑。
    修改了 所属模块 ,旧值为 "0",新值为 "1953"。
    修改了 业务部门 ,旧值为 "0",新值为 "2"。
    修改了 开发责任人,旧值为 "",新值为 "caijunwei"。
    修改了 测试责任人,旧值为 "",新值为 "ganfuzhi"。
    修改了 解决时效 ,旧值为 "0",新值为 "28.02"。
    修改了 重现步骤 ,区别为:
    001- 反馈人:王凯
    001+ 反馈人:王凯 数据库:zhcxkj_center_strategy_comprehensive 查询时间:89.7529 执行次数: 86 扫描行数:1496920 发送行数:463.849 指纹SQL: SELECT id , retry_status , source_id FROM ? WHERE ( source_id = ? AND status = ? ) limit ? ; 真实SQL:SELECT id,retry_status,source_id FROM t_strategy_execute_queue_picture_ozon WHERE (source_id = 25665 AND status = 0) limit 1000; 王凯,人工修改过 AISQL修改建议: 优化后的SQL语句 SELECT id, retry_status, source_id FROM t_strategy_execute_queue_picture_ozon WHERE source_id = 25665 AND status = 0 LIMIT 1000; 优化说明: 1. 移除了不必要的括号,简化了查询结构 2. 为了进一步提升性能,建议在 source_id 和 status 字段上创建复合索引: CREATE INDEX idx_source_status ON t_strategy_execute_queue_picture_ozon(source_id, status); explain表:id
    002- 数据库:zhcxkj_center_strategy_comprehensive
    002+ select_type
    003- 查询时间:89.7529
    003+ table
    004- 执行次数: 86
    004+ partitions
    005- 扫描行数:1496920
    005+ type
    006- 发送行数:463.849
    006+ possible_keys
    007- 指纹SQL: SELECT id , retry_status , source_id FROM ? WHERE ( source_id = ? AND status = ? ) limit ? ;
    007+ key
    008- 真实SQL:SELECT id,retry_status,source_id FROM t_strategy_execute_queue_picture_ozon WHERE (source_id = 25665 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
    013+ 1
    014- FROM t_strategy_execute_queue_picture_ozon
    014+ SIMPLE
    015- WHERE source_id = 25665 AND status = 0
    015+ t_strategy_execute_queue_picture_ozon
    016- LIMIT 1000;
    016+ None
    017-
    017+ ALL
    018-
    018+ None
    019- 优化说明:
    019+ None
    020- 1. 移除了不必要的括号,简化了查询结构
    020+ None
    021- 2. 为了进一步提升性能,建议在 source_id 和 status 字段上创建复合索引:
    021+ None
    022-
    022+ 3004977
    023- CREATE INDEX idx_source_status ON t_strategy_execute_queue_picture_ozon(source_id, status);
    023+ 1
    024- explain表:
    024+ Using where
    025-
    025+
    026-
    026+ 额外建议: 索引建议: 取出表 【t_strategy_execute_queue_picture_ozon】 where条件字段 【status】 100000 条记录,重复的数据有:【51918】 条。 建议添加索引:CREATE INDEX idx_source_status ON t_strategy_execute_queue_picture_ozon(source_id, status); 【t_strategy_execute_queue_picture_ozon】表 【source_id】字段,索引分析: +--------------+--------------+---------------+---------------+ | TABLE_NAME | INDEX_NAME | COLUMN_NAME | CARDINALITY | +==============+==============+===============+===============+ +--------------+--------------+---------------+---------------+
    027-
    028-
    029-
    030-
    031-
    032-
    033-
    034-
    035- id
    036-
    037-
    038- select_type
    039-
    040-
    041- table
    042-
    043-
    044- partitions
    045-
    046-
    047- type
    048-
    049-
    050- possible_keys
    051-
    052-
    053- key
    054-
    055-
    056- key_len
    057-
    058-
    059- ref
    060-
    061-
    062- rows
    063-
    064-
    065- filtered
    066-
    067-
    068- Extra
    069-
    070-
    071-
    072-
    073-
    074-
    075- 1
    076-
    077-
    078- SIMPLE
    079-
    080-
    081- t_strategy_execute_queue_picture_ozon
    082-
    083-
    084- None
    085-
    086-
    087- ALL
    088-
    089-
    090- None
    091-
    092-
    093- None
    094-
    095-
    096- None
    097-
    098-
    099- None
    100-
    101-
    102- 3004977
    103-
    104-
    105- 1
    106-
    107-
    108- Using where
    109-
    110-
    111-
    112-
    113-
    114- 额外建议:
    115- 索引建议:
    116- 取出表 【t_strategy_execute_queue_picture_ozon】 where条件字段 【status】 100000 条记录,重复的数据有:【51918】 条。
    117-
    118- 建议添加索引:CREATE INDEX idx_source_status ON t_strategy_execute_queue_picture_ozon(source_id, status);
    119-
    120- 【t_strategy_execute_queue_picture_ozon】表 【source_id】字段,索引分析:
    121- +--------------+--------------+---------------+---------------+
    122- | TABLE_NAME | INDEX_NAME | COLUMN_NAME | CARDINALITY |
    123- +==============+==============+===============+===============+
    124- +--------------+--------------+---------------+---------------+
    125-
    126-
    001- 反馈人:王凯<br />
    001+ 反馈人:王凯<br /> 数据库:zhcxkj_center_strategy_comprehensive<br /> 查询时间:89.7529<br /> 执行次数: 86<br /> 扫描行数:1496920<br /> 发送行数:463.849<br /> 指纹SQL: SELECT id , retry_status , source_id FROM ? WHERE ( source_id = ? AND status = ? ) limit ? ;<br /> 真实SQL:SELECT id,retry_status,source_id FROM t_strategy_execute_queue_picture_ozon WHERE (source_id = 25665 AND status = 0) limit 1000;<br /> 王凯,人工修改过<br /> AISQL修改建议: 优化后的SQL语句<br /><br /><br /> SELECT id, retry_status, source_id <br /> FROM t_strategy_execute_queue_picture_ozon <br /> WHERE source_id = 25665 AND status = 0 <br /> LIMIT 1000;<br /><br /><br /> 优化说明:<br /> 1. 移除了不必要的括号,简化了查询结构<br /> 2. 为了进一步提升性能,建议在 source_id 和 status 字段上创建复合索引:<br /><br /> CREATE INDEX idx_source_status ON t_strategy_execute_queue_picture_ozon(source_id, status);<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- 查询时间:89.7529<br />
    003+ <th>table</th>
    004- 执行次数: 86<br />
    004+ <th>partitions</th>
    005- 扫描行数:1496920<br />
    005+ <th>type</th>
    006- 发送行数:463.849<br />
    006+ <th>possible_keys</th>
    007- 指纹SQL: SELECT id , retry_status , source_id FROM ? WHERE ( source_id = ? AND status = ? ) limit ? ;<br />
    007+ <th>key</th>
    008- 真实SQL:SELECT id,retry_status,source_id FROM t_strategy_execute_queue_picture_ozon WHERE (source_id = 25665 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 <br />
    013+ </tr></tbody><tbody><tr><td>1</td>
    014- FROM t_strategy_execute_queue_picture_ozon <br />
    014+ <td>SIMPLE</td>
    015- WHERE source_id = 25665 AND status = 0 <br />
    015+ <td>t_strategy_execute_queue_picture_ozon</td>
    016- LIMIT 1000;<br />
    016+ <td>None</td>
    017- <br />
    017+ <td>ALL</td>
    018- <br />
    018+ <td>None</td>
    019- 优化说明:<br />
    019+ <td>None</td>
    020- 1. 移除了不必要的括号,简化了查询结构<br />
    020+ <td>None</td>
    021- 2. 为了进一步提升性能,建议在 source_id 和 status 字段上创建复合索引:<br />
    021+ <td>None</td>
    022- <br />
    022+ <td>3004977</td>
    023- CREATE INDEX idx_source_status ON t_strategy_execute_queue_picture_ozon(source_id, status);<br />
    023+ <td>1</td>
    024- explain表:<br />
    024+ <td>Using where</td>
    025- <br />
    025+ </tr></tbody></table><br />
    026- <br />
    026+ 额外建议:<br /> 索引建议:<br /> 取出表 【t_strategy_execute_queue_picture_ozon】 where条件字段 【status】 100000 条记录,重复的数据有:【51918】 条。<br /><span style="color:#FFA500;"><br /> 建议添加索引:CREATE INDEX idx_source_status ON t_strategy_execute_queue_picture_ozon(source_id, status);</span><br /><br /> 【t_strategy_execute_queue_picture_ozon】表 【source_id】字段,索引分析:<br /> +--------------+--------------+---------------+---------------+<br /> | TABLE_NAME | INDEX_NAME | COLUMN_NAME | CARDINALITY |<br /> +==============+==============+===============+===============+<br /> +--------------+--------------+---------------+---------------+<br /><br /><br />
    027- <br />
    028- <br />
    029- <br />
    030- <br />
    031- <table>
    032- <tbody>
    033- <tr>
    034- <th>
    035- id
    036- </th>
    037- <th>
    038- select_type
    039- </th>
    040- <th>
    041- table
    042- </th>
    043- <th>
    044- partitions
    045- </th>
    046- <th>
    047- type
    048- </th>
    049- <th>
    050- possible_keys
    051- </th>
    052- <th>
    053- key
    054- </th>
    055- <th>
    056- key_len
    057- </th>
    058- <th>
    059- ref
    060- </th>
    061- <th>
    062- rows
    063- </th>
    064- <th>
    065- filtered
    066- </th>
    067- <th>
    068- Extra
    069- </th>
    070- </tr>
    071- </tbody>
    072- <tbody>
    073- <tr>
    074- <td>
    075- 1
    076- </td>
    077- <td>
    078- SIMPLE
    079- </td>
    080- <td>
    081- t_strategy_execute_queue_picture_ozon
    082- </td>
    083- <td>
    084- None
    085- </td>
    086- <td>
    087- ALL
    088- </td>
    089- <td>
    090- None
    091- </td>
    092- <td>
    093- None
    094- </td>
    095- <td>
    096- None
    097- </td>
    098- <td>
    099- None
    100- </td>
    101- <td>
    102- 3004977
    103- </td>
    104- <td>
    105- 1
    106- </td>
    107- <td>
    108- Using where
    109- </td>
    110- </tr>
    111- </tbody>
    112- </table>
    113- <br />
    114- 额外建议:<br />
    115- 索引建议:<br />
    116- 取出表 【t_strategy_execute_queue_picture_ozon】 where条件字段 【status】 100000 条记录,重复的数据有:【51918】 条。<br />
    117- <span style="color:FFA500;"><br />
    118- 建议添加索引:CREATE INDEX idx_source_status ON t_strategy_execute_queue_picture_ozon(source_id, status);</span><br />
    119- <br />
    120- 【t_strategy_execute_queue_picture_ozon】表 【source_id】字段,索引分析:<br />
    121- +--------------+--------------+---------------+---------------+<br />
    122- | TABLE_NAME | INDEX_NAME | COLUMN_NAME | CARDINALITY |<br />
    123- +==============+==============+===============+===============+<br />
    124- +--------------+--------------+---------------+---------------+<br />
    125- <br />
    126- <br />
  4. 2025-09-02 19:46:59, 由 李乐同 关闭。
    修改了 Bug状态 ,旧值为 "resolved",新值为 "closed"。
    修改了 指派给 ,旧值为 "liletong",新值为 "closed"。
    修改了 由谁关闭,旧值为 "",新值为 "liletong"。
    修改了 关闭日期,旧值为 "",新值为 "2025-09-02 19:46:59"。
所属项目 技术中心-需求池
所属模块 多平台   OZON
所属计划
所属迭代
Bug类型
严重程度 一般
优先级 P2
Bug状态 已关闭
业务部门 总经办
影响功能
开发责任人 蔡俊伟
测试责任人 甘福志
解决时效 28.02
激活次数 0
激活日期
是否确认 是
当前指派 Closed 于 2025-09-02 19:46:59
截止日期 0000-00-00
上线时间 2025-09-02 19:46:00
上线时效 28.06
操作系统
浏览器
关键词
抄送给
所属迭代
相关需求
相关任务
由谁创建 李乐同 于 2025-09-01 15:42:35
影响环境 生产环境-业务反馈
由谁解决 蔡俊伟 于 2025-09-02 19:43:43
解决版本 主干
解决方案 性能问题
由谁关闭 李乐同 于 2025-09-02 19:46:59
最后修改 李乐同 于 2025-09-02 19:46:59
相关Bug