重现步骤
反馈人:袁慧斌
数据库:zhcxkj_center_crm
查询时间:13.548
扫描行数:9778.96
发送行数:4686.12
指纹SQL: select * FROM ? where create_time >= ? and platform = ? ;
真实SQL:select * from t_crm_message_aliexpress where create_time >= 2025-08-05 and platform = 57;
无人工修改
AISQL修改建议: 优化后的SQL语句


SELECT id, /* 这里列出你实际需要的字段而不是使用* */
FROM t_crm_message_aliexpress
WHERE create_time >= 2025-08-05
AND platform = 57
ORDER BY create_time
LIMIT 1000; /* 根据实际情况调整限制数量 */

-- 建议在create_time和platform字段上创建复合索引
-- CREATE INDEX idx_msg_aliexpress_time_platform ON t_crm_message_aliexpress(create_time, platform);


优化说明:
1. 避免使用SELECT *,只查询需要的字段
2. 添加ORDER BY子句确保结果有序
3. 添加LIMIT限制返回数据量
4. 建议创建复合索引提高查询效率
explain表:






id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t_crm_message_aliexpress None range idx_create_time,idx_order_source idx_create_time 9 None 14900 100 Using index condition

额外建议:
索引建议:
取出表 【t_crm_message_aliexpress】 where条件表达式 【platform = 57】 100000 条记录,重复的数据有:【100000】 条,没有必要为该字段创建索引。

→ 【t_crm_message_aliexpress】表 【create_time】字段,索引已经存在,无需添加任何索引。

【t_crm_message_aliexpress】表 【create_time】字段,索引分析:
+--------------------------+--------------------------------+---------------+---------------+
| TABLE_NAME | INDEX_NAME | COLUMN_NAME | CARDINALITY |
+==========================+================================+===============+===============+
| t_crm_message_aliexpress | idx_create_time | create_time | 830661 |
+--------------------------+--------------------------------+---------------+---------------+
| t_crm_message_aliexpress | t_crm_message_aliexpress_messa | create_time | 1104905 |
| | ge_type_IDX | | |
+--------------------------+--------------------------------+---------------+---------------+


历史记录  
  1. 2025-08-12 09:03:24, 由 陈莉珍 创建。
  2. 2025-08-12 09:03:56, 由 陈莉珍 指派给 王海浪。
    修改了 指派给,旧值为 "yangjinxuan",新值为 "wanghailang"。
  3. 2025-08-12 11:31:20, 由 王海浪 解决,方案为 性能问题 。
    修改了 解决方案,旧值为 "",新值为 "performance"。
    修改了 解决日期,旧值为 "",新值为 "2025-08-12 11:30:40"。
    修改了 指派给 ,旧值为 "wanghailang",新值为 "chenlizhen"。
    修改了 Bug状态 ,旧值为 "active",新值为 "resolved"。
    修改了 是否确认,旧值为 "0",新值为 "1"。
    修改了 解决者 ,旧值为 "",新值为 "wanghailang"。
    datax 数据同步,已调整时间范围
  4. 2025-08-12 14:59:28, 由 陈莉珍 编辑。
    修改了 所属模块 ,旧值为 "0",新值为 "1858"。
    修改了 业务部门 ,旧值为 "0",新值为 "2"。
    修改了 开发责任人,旧值为 "",新值为 "wanghailang"。
    修改了 测试责任人,旧值为 "",新值为 "wanghailang"。
    修改了 解决时效 ,旧值为 "0",新值为 "2.45"。
    修改了 重现步骤 ,区别为:
    001- 反馈人:袁慧斌
    001+ 反馈人:袁慧斌 数据库:zhcxkj_center_crm 查询时间:13.548 扫描行数:9778.96 发送行数:4686.12 指纹SQL: select * FROM ? where create_time >= ? and platform = ? ; 真实SQL:select * from t_crm_message_aliexpress where create_time >= 2025-08-05 and platform = 57; 无人工修改 AISQL修改建议: 优化后的SQL语句 SELECT id, /* 这里列出你实际需要的字段而不是使用* */ FROM t_crm_message_aliexpress WHERE create_time >= 2025-08-05 AND platform = 57 ORDER BY create_time LIMIT 1000; /* 根据实际情况调整限制数量 */ -- 建议在create_time和platform字段上创建复合索引 -- CREATE INDEX idx_msg_aliexpress_time_platform ON t_crm_message_aliexpress(create_time, platform); 优化说明: 1. 避免使用SELECT *,只查询需要的字段 2. 添加ORDER BY子句确保结果有序 3. 添加LIMIT限制返回数据量 4. 建议创建复合索引提高查询效率 explain表:id
    002- 数据库:zhcxkj_center_crm
    002+ select_type
    003- 查询时间:13.548
    003+ table
    004- 扫描行数:9778.96
    004+ partitions
    005- 发送行数:4686.12
    005+ type
    006- 指纹SQL: select * FROM ? where create_time >= ? and platform = ? ;
    006+ possible_keys
    007- 真实SQL:select * from t_crm_message_aliexpress where create_time >= 2025-08-05 and platform = 57;
    007+ key
    008- 无人工修改
    008+ key_len
    009- AISQL修改建议: 优化后的SQL语句
    009+ ref
    010-
    010+ rows
    011-
    011+ filtered
    012- SELECT id, /* 这里列出你实际需要的字段而不是使用* */
    012+ Extra
    013- FROM t_crm_message_aliexpress
    013+ 1
    014- WHERE create_time >= 2025-08-05
    014+ SIMPLE
    015- AND platform = 57
    015+ t_crm_message_aliexpress
    016- ORDER BY create_time
    016+ None
    017- LIMIT 1000; /* 根据实际情况调整限制数量 */
    017+ range
    018-
    018+ idx_create_time,idx_order_source
    019- -- 建议在create_time和platform字段上创建复合索引
    019+ idx_create_time
    020- -- CREATE INDEX idx_msg_aliexpress_time_platform ON t_crm_message_aliexpress(create_time, platform);
    020+ 9
    021-
    021+ None
    022-
    022+ 14900
    023- 优化说明:
    023+ 100
    024- 1. 避免使用SELECT *,只查询需要的字段
    024+ Using index condition
    025- 2. 添加ORDER BY子句确保结果有序
    025+
    026- 3. 添加LIMIT限制返回数据量
    026+ 额外建议: 索引建议: 取出表 【t_crm_message_aliexpress】 where条件表达式 【platform = 57】 100000 条记录,重复的数据有:【100000】 条,没有必要为该字段创建索引。→ 【t_crm_message_aliexpress】表 【create_time】字段,索引已经存在,无需添加任何索引。 【t_crm_message_aliexpress】表 【create_time】字段,索引分析: +--------------------------+--------------------------------+---------------+---------------+ | TABLE_NAME | INDEX_NAME | COLUMN_NAME | CARDINALITY | +==========================+================================+===============+===============+ | t_crm_message_aliexpress | idx_create_time | create_time | 830661 | +--------------------------+--------------------------------+---------------+---------------+ | t_crm_message_aliexpress | t_crm_message_aliexpress_messa | create_time | 1104905 | | | ge_type_IDX | | | +--------------------------+--------------------------------+---------------+---------------+
    027- 4. 建议创建复合索引提高查询效率
    028- explain表:
    029-
    030-
    031-
    032-
    033-
    034-
    035-
    036-
    037-
    038-
    039- id
    040-
    041-
    042- select_type
    043-
    044-
    045- table
    046-
    047-
    048- partitions
    049-
    050-
    051- type
    052-
    053-
    054- possible_keys
    055-
    056-
    057- key
    058-
    059-
    060- key_len
    061-
    062-
    063- ref
    064-
    065-
    066- rows
    067-
    068-
    069- filtered
    070-
    071-
    072- Extra
    073-
    074-
    075-
    076-
    077-
    078-
    079- 1
    080-
    081-
    082- SIMPLE
    083-
    084-
    085- t_crm_message_aliexpress
    086-
    087-
    088- None
    089-
    090-
    091- range
    092-
    093-
    094- idx_create_time,idx_order_source
    095-
    096-
    097- idx_create_time
    098-
    099-
    100- 9
    101-
    102-
    103- None
    104-
    105-
    106- 14900
    107-
    108-
    109- 100
    110-
    111-
    112- Using index condition
    113-
    114-
    115-
    116-
    117-
    118- 额外建议:
    119- 索引建议:
    120- 取出表 【t_crm_message_aliexpress】 where条件表达式 【platform = 57】 100000 条记录,重复的数据有:【100000】 条,没有必要为该字段创建索引。
    121-
    122- → 【t_crm_message_aliexpress】表 【create_time】字段,索引已经存在,无需添加任何索引。
    123-
    124- 【t_crm_message_aliexpress】表 【create_time】字段,索引分析:
    125- +--------------------------+--------------------------------+---------------+---------------+
    126- | TABLE_NAME | INDEX_NAME | COLUMN_NAME | CARDINALITY |
    127- +==========================+================================+===============+===============+
    128- | t_crm_message_aliexpress | idx_create_time | create_time | 830661 |
    129- +--------------------------+--------------------------------+---------------+---------------+
    130- | t_crm_message_aliexpress | t_crm_message_aliexpress_messa | create_time | 1104905 |
    131- | | ge_type_IDX | | |
    132- +--------------------------+--------------------------------+---------------+---------------+
    133-
    134-
    001- 反馈人:袁慧斌<br />
    001+ 反馈人:袁慧斌<br /> 数据库:zhcxkj_center_crm<br /> 查询时间:13.548<br /> 扫描行数:9778.96<br /> 发送行数:4686.12<br /> 指纹SQL: select * FROM ? where create_time &gt;= ? and platform = ? ;<br /> 真实SQL:select * from t_crm_message_aliexpress where create_time &gt;= 2025-08-05 and platform = 57;<br /> 无人工修改<br /> AISQL修改建议: 优化后的SQL语句<br /><br /><br /> SELECT id, /* 这里列出你实际需要的字段而不是使用* */<br /> FROM t_crm_message_aliexpress<br /> WHERE create_time &gt;= 2025-08-05<br /> AND platform = 57<br /> ORDER BY create_time<br /> LIMIT 1000; /* 根据实际情况调整限制数量 */<br /><br /> -- 建议在create_time和platform字段上创建复合索引<br /> -- CREATE INDEX idx_msg_aliexpress_time_platform ON t_crm_message_aliexpress(create_time, platform);<br /><br /><br /> 优化说明:<br /> 1. 避免使用SELECT *,只查询需要的字段<br /> 2. 添加ORDER BY子句确保结果有序<br /> 3. 添加LIMIT限制返回数据量<br /> 4. 建议创建复合索引提高查询效率<br /> explain表:<br /><br /><br /><br /><br /><br /><br /><table><tbody><tr><th>id</th>
    002- 数据库:zhcxkj_center_crm<br />
    002+ <th>select_type</th>
    003- 查询时间:13.548<br />
    003+ <th>table</th>
    004- 扫描行数:9778.96<br />
    004+ <th>partitions</th>
    005- 发送行数:4686.12<br />
    005+ <th>type</th>
    006- 指纹SQL: select * FROM ? where create_time &gt;= ? and platform = ? ;<br />
    006+ <th>possible_keys</th>
    007- 真实SQL:select * from t_crm_message_aliexpress where create_time &gt;= 2025-08-05 and platform = 57;<br />
    007+ <th>key</th>
    008- 无人工修改<br />
    008+ <th>key_len</th>
    009- AISQL修改建议: 优化后的SQL语句<br />
    009+ <th>ref</th>
    010- <br />
    010+ <th>rows</th>
    011- <br />
    011+ <th>filtered</th>
    012- SELECT id, /* 这里列出你实际需要的字段而不是使用* */<br />
    012+ <th>Extra</th>
    013- FROM t_crm_message_aliexpress<br />
    013+ </tr></tbody><tbody><tr><td>1</td>
    014- WHERE create_time &gt;= 2025-08-05<br />
    014+ <td>SIMPLE</td>
    015- AND platform = 57<br />
    015+ <td>t_crm_message_aliexpress</td>
    016- ORDER BY create_time<br />
    016+ <td>None</td>
    017- LIMIT 1000; /* 根据实际情况调整限制数量 */<br />
    017+ <td>range</td>
    018- <br />
    018+ <td>idx_create_time,idx_order_source</td>
    019- -- 建议在create_time和platform字段上创建复合索引<br />
    019+ <td>idx_create_time</td>
    020- -- CREATE INDEX idx_msg_aliexpress_time_platform ON t_crm_message_aliexpress(create_time, platform);<br />
    020+ <td>9</td>
    021- <br />
    021+ <td>None</td>
    022- <br />
    022+ <td>14900</td>
    023- 优化说明:<br />
    023+ <td>100</td>
    024- 1. 避免使用SELECT *,只查询需要的字段<br />
    024+ <td>Using index condition</td>
    025- 2. 添加ORDER BY子句确保结果有序<br />
    025+ </tr></tbody></table><br />
    026- 3. 添加LIMIT限制返回数据量<br />
    026+ 额外建议:<br /> 索引建议:<br /> 取出表 【t_crm_message_aliexpress】 where条件表达式 【platform = 57】 100000 条记录,重复的数据有:【100000】 条,没有必要为该字段创建索引。<br /><br /><span style="color:#008000;font-weight:bold;">→ 【t_crm_message_aliexpress】表 【create_time】字段,索引已经存在,无需添加任何索引。</span><br /><br /> 【t_crm_message_aliexpress】表 【create_time】字段,索引分析:<br /> +--------------------------+--------------------------------+---------------+---------------+<br /> | TABLE_NAME | INDEX_NAME | COLUMN_NAME | CARDINALITY |<br /> +==========================+================================+===============+===============+<br /> | t_crm_message_aliexpress | idx_create_time | create_time | 830661 |<br /> +--------------------------+--------------------------------+---------------+---------------+<br /> | t_crm_message_aliexpress | t_crm_message_aliexpress_messa | create_time | 1104905 |<br /> | | ge_type_IDX | | |<br /> +--------------------------+--------------------------------+---------------+---------------+<br /><br /><br />
    027- 4. 建议创建复合索引提高查询效率<br />
    028- explain表:<br />
    029- <br />
    030- <br />
    031- <br />
    032- <br />
    033- <br />
    034- <br />
    035- <table>
    036- <tbody>
    037- <tr>
    038- <th>
    039- id
    040- </th>
    041- <th>
    042- select_type
    043- </th>
    044- <th>
    045- table
    046- </th>
    047- <th>
    048- partitions
    049- </th>
    050- <th>
    051- type
    052- </th>
    053- <th>
    054- possible_keys
    055- </th>
    056- <th>
    057- key
    058- </th>
    059- <th>
    060- key_len
    061- </th>
    062- <th>
    063- ref
    064- </th>
    065- <th>
    066- rows
    067- </th>
    068- <th>
    069- filtered
    070- </th>
    071- <th>
    072- Extra
    073- </th>
    074- </tr>
    075- </tbody>
    076- <tbody>
    077- <tr>
    078- <td>
    079- 1
    080- </td>
    081- <td>
    082- SIMPLE
    083- </td>
    084- <td>
    085- t_crm_message_aliexpress
    086- </td>
    087- <td>
    088- None
    089- </td>
    090- <td>
    091- range
    092- </td>
    093- <td>
    094- idx_create_time,idx_order_source
    095- </td>
    096- <td>
    097- idx_create_time
    098- </td>
    099- <td>
    100- 9
    101- </td>
    102- <td>
    103- None
    104- </td>
    105- <td>
    106- 14900
    107- </td>
    108- <td>
    109- 100
    110- </td>
    111- <td>
    112- Using index condition
    113- </td>
    114- </tr>
    115- </tbody>
    116- </table>
    117- <br />
    118- 额外建议:<br />
    119- 索引建议:<br />
    120- 取出表 【t_crm_message_aliexpress】 where条件表达式 【platform = 57】 100000 条记录,重复的数据有:【100000】 条,没有必要为该字段创建索引。<br />
    121- <br />
    122- <span style="color:green;font-weight:bold;">→ 【t_crm_message_aliexpress】表 【create_time】字段,索引已经存在,无需添加任何索引。</span><br />
    123- <br />
    124- 【t_crm_message_aliexpress】表 【create_time】字段,索引分析:<br />
    125- +--------------------------+--------------------------------+---------------+---------------+<br />
    126- | TABLE_NAME | INDEX_NAME | COLUMN_NAME | CARDINALITY |<br />
    127- +==========================+================================+===============+===============+<br />
    128- | t_crm_message_aliexpress | idx_create_time | create_time | 830661 |<br />
    129- +--------------------------+--------------------------------+---------------+---------------+<br />
    130- | t_crm_message_aliexpress | t_crm_message_aliexpress_messa | create_time | 1104905 |<br />
    131- | | ge_type_IDX | | |<br />
    132- +--------------------------+--------------------------------+---------------+---------------+<br />
    133- <br />
    134- <br />
  5. 2025-08-12 14:59:31, 由 陈莉珍 关闭。
    修改了 Bug状态 ,旧值为 "resolved",新值为 "closed"。
    修改了 指派给 ,旧值为 "chenlizhen",新值为 "closed"。
    修改了 由谁关闭,旧值为 "",新值为 "chenlizhen"。
    修改了 关闭日期,旧值为 "",新值为 "2025-08-12 14:59:31"。
所属项目 技术中心-需求池
所属模块 客服账号   客服CRM
所属计划
所属迭代
Bug类型
严重程度 一般
优先级 P2
Bug状态 已关闭
业务部门 总经办
影响功能
开发责任人 王海浪
测试责任人 王海浪
解决时效 2.45
激活次数 0
激活日期
是否确认 是
当前指派 Closed 于 2025-08-12 14:59:31
截止日期 0000-00-00
上线时间 2025-08-12 11:30:00
上线时效 2.44
操作系统
浏览器
关键词
抄送给
所属迭代
相关需求
相关任务
由谁创建 陈莉珍 于 2025-08-12 09:03:24
影响环境 生产环境-业务反馈
由谁解决 王海浪 于 2025-08-12 11:30:40
解决版本
解决方案 性能问题
由谁关闭 陈莉珍 于 2025-08-12 14:59:31
最后修改 陈莉珍 于 2025-08-12 14:59:31
相关Bug