重现步骤

反馈人:王凯

问题1:

数据库:zhcxkj_center_listing_comprehensive
查询时间:46.2186
扫描行数:2269870
发送行数:200
指纹SQL: SELECT id , source_sku , source_id , pf_listing_id , pf_global_listing_id FROM ? WHERE ( source_id = ? AND status IN ( ? , ? ) AND is_deleted = ? ) ORDER BY id ASC limit ? ;
真实SQL:SELECT id,source_sku,source_id,pf_listing_id,pf_global_listing_id FROM t_listing_mercadolibre WHERE (source_id = 10833 AND status IN (1,3) AND is_deleted = 0) ORDER BY id ASC limit 200;
无人工修改
AISQL修改建议: 优化后的SQL语句


SELECT id, source_sku, source_id, pf_listing_id, pf_global_listing_id
FROM t_listing_mercadolibre
WHERE source_id = 10833 AND status IN (1, 3) AND is_deleted = 0
ORDER BY id ASC
LIMIT 200;


建议创建以下复合索引以提升查询性能:


CREATE INDEX idx_listing_mercadolibre_optim ON t_listing_mercadolibre(source_id, status, is_deleted, id);


这个复合索引能够覆盖WHERE条件和ORDER BY子句,可以显著提高查询效率。
explain表:






id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t_listing_mercadolibre None index uk_source_id_country_code_pf_listing_logistic_type_platform_type,idx_status,idx_source_id_update_time,idx_source_site_status,IDX_is_deleted_source_id_status_id PRIMARY 8 None 38139 0.1 Using where

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

取出表 【t_listing_mercadolibre】 where条件字段 【is_deleted】 100000 条记录,重复的数据有:【100000】 条,没有必要为该字段创建索引。

→ 【t_listing_mercadolibre】表 【source_id,id】字段,联合索引已经存在,无需添加任何索引。

【t_listing_mercadolibre】表 【source_id,id】字段,索引分析:
+------------------------+--------------------------------+---------------+---------------+
| TABLE_NAME | INDEX_NAME | COLUMN_NAME | CARDINALITY |
+========================+================================+===============+===============+
| t_listing_mercadolibre | IDX_is_deleted_source_id_statu | id | 8278215 |
| | s_id | | |
+------------------------+--------------------------------+---------------+---------------+
| t_listing_mercadolibre | IDX_is_deleted_source_id_statu | source_id | 18240 |
| | s_id | | |
+------------------------+--------------------------------+---------------+---------------+
| t_listing_mercadolibre | idx_sku | source_id | 4267993 |
+------------------------+--------------------------------+---------------+---------------+
| t_listing_mercadolibre | idx_source_id_update_time | source_id | 15164 |
+------------------------+--------------------------------+---------------+---------------+
| t_listing_mercadolibre | idx_source_site_status | source_id | 20112 |
+------------------------+--------------------------------+---------------+---------------+
| t_listing_mercadolibre | PRIMARY | id | 8278215 |
+------------------------+--------------------------------+---------------+---------------+
| t_listing_mercadolibre | uk_source_id_country_code_pf_l | source_id | 13723 |
| | isting_logistic_type_platform_ | | |
| | type | | |
+------------------------+--------------------------------+---------------+---------------+

问题2:

数据库:zhcxkj_center_listing_comprehensive
查询时间:14.3059
扫描行数:336699
发送行数:1
指纹SQL: SELECT COUNT ( * ) FROM ? WHERE ( source_id = ? AND country_code = ? AND logistic_type = ? AND status IN ( ? ) ) ;
真实SQL:SELECT COUNT( * ) FROM t_listing_mercadolibre WHERE (source_id = 28058 AND country_code = MLB AND logistic_type = remote AND status IN (3));
王凯,人工修改过
AISQL修改建议:CREATE INDEX idx_listing_optim ON t_listing_mercadolibre(source_id, country_code, logistic_type, status);
explain表:




id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t_listing_mercadolibre None ref uk_source_id_country_code_pf_listing_logistic_type_platform_type,idx_status,idx_source_id_update_time,idx_source_site_status idx_source_site_status 56 const,const,const 618074 10 Using where

额外建议:
索引建议:
历史记录  
  1. 2025-08-12 09:04:47, 由 陈莉珍 创建。
  2. 2025-08-12 09:06:18, 由 陈莉珍 编辑。
    修改了 所属模块,旧值为 "0",新值为 "1874"。
    修改了 业务部门,旧值为 "0",新值为 "2"。
    修改了 解决时效,旧值为 "0",新值为 "-1"。
    修改了 重现步骤,区别为:
    001- 反馈人:王凯
    001+ 反馈人:王凯
    002- 数据库:zhcxkj_center_listing_comprehensive
    002+ 问题1:
    003- 查询时间:46.2186
    003+ 数据库:zhcxkj_center_listing_comprehensive
    004- 扫描行数:2269870
    004+ 查询时间:46.2186 扫描行数:2269870 发送行数:200 指纹SQL: SELECT id , source_sku , source_id , pf_listing_id , pf_global_listing_id FROM ? WHERE ( source_id = ? AND status IN ( ? , ? ) AND is_deleted = ? ) ORDER BY id ASC limit ? ; 真实SQL:SELECT id,source_sku,source_id,pf_listing_id,pf_global_listing_id FROM t_listing_mercadolibre WHERE (source_id = 10833 AND status IN (1,3) AND is_deleted = 0) ORDER BY id ASC limit 200; 无人工修改 AISQL修改建议: 优化后的SQL语句 SELECT id, source_sku, source_id, pf_listing_id, pf_global_listing_id FROM t_listing_mercadolibre WHERE source_id = 10833 AND status IN (1, 3) AND is_deleted = 0 ORDER BY id ASC LIMIT 200; 建议创建以下复合索引以提升查询性能: CREATE INDEX idx_listing_mercadolibre_optim ON t_listing_mercadolibre(source_id, status, is_deleted, id); 这个复合索引能够覆盖WHERE条件和ORDER BY子句,可以显著提高查询效率。 explain表:id
    005- 发送行数:200
    005+ select_type
    006- 指纹SQL: SELECT id , source_sku , source_id , pf_listing_id , pf_global_listing_id FROM ? WHERE ( source_id = ? AND status IN ( ? , ? ) AND is_deleted = ? ) ORDER BY id ASC limit ? ;
    006+ table
    007- 真实SQL:SELECT id,source_sku,source_id,pf_listing_id,pf_global_listing_id FROM t_listing_mercadolibre WHERE (source_id = 10833 AND status IN (1,3) AND is_deleted = 0) ORDER BY id ASC limit 200;
    007+ partitions
    008- 无人工修改
    008+ type
    009- AISQL修改建议: 优化后的SQL语句
    009+ possible_keys
    010-
    010+ key
    011-
    011+ key_len
    012- SELECT id, source_sku, source_id, pf_listing_id, pf_global_listing_id
    012+ ref
    013- FROM t_listing_mercadolibre
    013+ rows
    014- WHERE source_id = 10833 AND status IN (1, 3) AND is_deleted = 0
    014+ filtered
    015- ORDER BY id ASC
    015+ Extra
    016- LIMIT 200;
    016+ 1
    017-
    017+ SIMPLE
    018-
    018+ t_listing_mercadolibre
    019- 建议创建以下复合索引以提升查询性能:
    019+ None
    020-
    020+ index
    021-
    021+ uk_source_id_country_code_pf_listing_logistic_type_platform_type,idx_status,idx_source_id_update_time,idx_source_site_status,IDX_is_deleted_source_id_status_id
    022- CREATE INDEX idx_listing_mercadolibre_optim ON t_listing_mercadolibre(source_id, status, is_deleted, id);
    022+ PRIMARY
    023-
    023+ 8
    024-
    024+ None
    025- 这个复合索引能够覆盖WHERE条件和ORDER BY子句,可以显著提高查询效率。
    025+ 38139
    026- explain表:
    026+ 0.1
    027-
    027+ Using where
    028-
    028+
    029-
    029+ 额外建议: 索引建议: 取出表 【t_listing_mercadolibre】 where条件字段 【status】 100000 条记录,重复的数据有:【100000】 条,没有必要为该字段创建索引。 取出表 【t_listing_mercadolibre】 where条件字段 【is_deleted】 100000 条记录,重复的数据有:【100000】 条,没有必要为该字段创建索引。→ 【t_listing_mercadolibre】表 【source_id,id】字段,联合索引已经存在,无需添加任何索引。 【t_listing_mercadolibre】表 【source_id,id】字段,索引分析: +------------------------+--------------------------------+---------------+---------------+ | TABLE_NAME | INDEX_NAME | COLUMN_NAME | CARDINALITY | +========================+================================+===============+===============+ | t_listing_mercadolibre | IDX_is_deleted_source_id_statu | id | 8278215 | | | s_id | | | +------------------------+--------------------------------+---------------+---------------+ | t_listing_mercadolibre | IDX_is_deleted_source_id_statu | source_id | 18240 | | | s_id | | | +------------------------+--------------------------------+---------------+---------------+ | t_listing_mercadolibre | idx_sku | source_id | 4267993 | +------------------------+--------------------------------+---------------+---------------+ | t_listing_mercadolibre | idx_source_id_update_time | source_id | 15164 | +------------------------+--------------------------------+---------------+---------------+ | t_listing_mercadolibre | idx_source_site_status | source_id | 20112 | +------------------------+--------------------------------+---------------+---------------+ | t_listing_mercadolibre | PRIMARY | id | 8278215 | +------------------------+--------------------------------+---------------+---------------+ | t_listing_mercadolibre | uk_source_id_country_code_pf_l | source_id | 13723 | | | isting_logistic_type_platform_ | | | | | type | | | +------------------------+--------------------------------+---------------+---------------+问题2:
    030-
    030+ 数据库:zhcxkj_center_listing_comprehensive查询时间:14.3059扫描行数:336699发送行数:1指纹SQL: SELECT COUNT ( * ) FROM ? WHERE ( source_id = ? AND country_code = ? AND logistic_type = ? AND status IN ( ? ) ) ;真实SQL:SELECT COUNT( * ) FROM t_listing_mercadolibre WHERE (source_id = 28058 AND country_code = MLB AND logistic_type = remote AND status IN (3));王凯,人工修改过AISQL修改建议:CREATE INDEX idx_listing_optim ON t_listing_mercadolibre(source_id, country_code, logistic_type, status);explain表:id
    031-
    031+ select_type
    032-
    032+ table
    033-
    033+ partitions
    034-
    034+ type
    035-
    035+ possible_keys
    036-
    036+ key
    037- id
    037+ key_len
    038-
    038+ ref
    039-
    039+ rows
    040- select_type
    040+ filtered
    041-
    041+ Extra
    042-
    042+ 1
    043- table
    043+ SIMPLE
    044-
    044+ t_listing_mercadolibre
    045-
    045+ None
    046- partitions
    046+ ref
    047-
    047+ uk_source_id_country_code_pf_listing_logistic_type_platform_type,idx_status,idx_source_id_update_time,idx_source_site_status
    048-
    048+ idx_source_site_status
    049- type
    049+ 56
    050-
    050+ const,const,const
    051-
    051+ 618074
    052- possible_keys
    052+ 10
    053-
    053+ Using where
    054-
    054+ 额外建议:索引建议:
    055- key
    056-
    057-
    058- key_len
    059-
    060-
    061- ref
    062-
    063-
    064- rows
    065-
    066-
    067- filtered
    068-
    069-
    070- Extra
    071-
    072-
    073-
    074-
    075-
    076-
    077- 1
    078-
    079-
    080- SIMPLE
    081-
    082-
    083- t_listing_mercadolibre
    084-
    085-
    086- None
    087-
    088-
    089- index
    090-
    091-
    092- uk_source_id_country_code_pf_listing_logistic_type_platform_type,idx_status,idx_source_id_update_time,idx_source_site_status,IDX_is_deleted_source_id_status_id
    093-
    094-
    095- PRIMARY
    096-
    097-
    098- 8
    099-
    100-
    101- None
    102-
    103-
    104- 38139
    105-
    106-
    107- 0.1
    108-
    109-
    110- Using where
    111-
    112-
    113-
    114-
    115-
    116- 额外建议:
    117- 索引建议:
    118- 取出表 【t_listing_mercadolibre】 where条件字段 【status】 100000 条记录,重复的数据有:【100000】 条,没有必要为该字段创建索引。
    119-
    120- 取出表 【t_listing_mercadolibre】 where条件字段 【is_deleted】 100000 条记录,重复的数据有:【100000】 条,没有必要为该字段创建索引。
    121-
    122- → 【t_listing_mercadolibre】表 【source_id,id】字段,联合索引已经存在,无需添加任何索引。
    123-
    124- 【t_listing_mercadolibre】表 【source_id,id】字段,索引分析:
    125- +------------------------+--------------------------------+---------------+---------------+
    126- | TABLE_NAME | INDEX_NAME | COLUMN_NAME | CARDINALITY |
    127- +========================+================================+===============+===============+
    128- | t_listing_mercadolibre | IDX_is_deleted_source_id_statu | id | 8278215 |
    129- | | s_id | | |
    130- +------------------------+--------------------------------+---------------+---------------+
    131- | t_listing_mercadolibre | IDX_is_deleted_source_id_statu | source_id | 18240 |
    132- | | s_id | | |
    133- +------------------------+--------------------------------+---------------+---------------+
    134- | t_listing_mercadolibre | idx_sku | source_id | 4267993 |
    135- +------------------------+--------------------------------+---------------+---------------+
    136- | t_listing_mercadolibre | idx_source_id_update_time | source_id | 15164 |
    137- +------------------------+--------------------------------+---------------+---------------+
    138- | t_listing_mercadolibre | idx_source_site_status | source_id | 20112 |
    139- +------------------------+--------------------------------+---------------+---------------+
    140- | t_listing_mercadolibre | PRIMARY | id | 8278215 |
    141- +------------------------+--------------------------------+---------------+---------------+
    142- | t_listing_mercadolibre | uk_source_id_country_code_pf_l | source_id | 13723 |
    143- | | isting_logistic_type_platform_ | | |
    144- | | type | | |
    145- +------------------------+--------------------------------+---------------+---------------+
    146-
    147-
    001- 反馈人:王凯<br />
    001+ <p>反馈人:王凯</p>
    002- 数据库:zhcxkj_center_listing_comprehensive<br />
    002+ <p>问题1:</p>
    003- 查询时间:46.2186<br />
    003+ 数据库:zhcxkj_center_listing_comprehensive<br />
    004- 扫描行数:2269870<br />
    004+ 查询时间:46.2186<br /> 扫描行数:2269870<br /> 发送行数:200<br /> 指纹SQL: SELECT id , source_sku , source_id , pf_listing_id , pf_global_listing_id FROM ? WHERE ( source_id = ? AND status IN ( ? , ? ) AND is_deleted = ? ) ORDER BY id ASC limit ? ;<br /> 真实SQL:SELECT id,source_sku,source_id,pf_listing_id,pf_global_listing_id FROM t_listing_mercadolibre WHERE (source_id = 10833 AND status IN (1,3) AND is_deleted = 0) ORDER BY id ASC limit 200;<br /> 无人工修改<br /> AISQL修改建议: 优化后的SQL语句<br /><br /><br /> SELECT id, source_sku, source_id, pf_listing_id, pf_global_listing_id <br /> FROM t_listing_mercadolibre <br /> WHERE source_id = 10833 AND status IN (1, 3) AND is_deleted = 0 <br /> ORDER BY id ASC <br /> LIMIT 200;<br /><br /><br /> 建议创建以下复合索引以提升查询性能:<br /><br /><br /> CREATE INDEX idx_listing_mercadolibre_optim ON t_listing_mercadolibre(source_id, status, is_deleted, id);<br /><br /><br /> 这个复合索引能够覆盖WHERE条件和ORDER BY子句,可以显著提高查询效率。<br /> explain表:<br /><br /><br /><br /><br /><br /><br /><table><tbody><tr><th>id</th>
    005- 发送行数:200<br />
    005+ <th>select_type</th>
    006- 指纹SQL: SELECT id , source_sku , source_id , pf_listing_id , pf_global_listing_id FROM ? WHERE ( source_id = ? AND status IN ( ? , ? ) AND is_deleted = ? ) ORDER BY id ASC limit ? ;<br />
    006+ <th>table</th>
    007- 真实SQL:SELECT id,source_sku,source_id,pf_listing_id,pf_global_listing_id FROM t_listing_mercadolibre WHERE (source_id = 10833 AND status IN (1,3) AND is_deleted = 0) ORDER BY id ASC limit 200;<br />
    007+ <th>partitions</th>
    008- 无人工修改<br />
    008+ <th>type</th>
    009- AISQL修改建议: 优化后的SQL语句<br />
    009+ <th>possible_keys</th>
    010- <br />
    010+ <th>key</th>
    011- <br />
    011+ <th>key_len</th>
    012- SELECT id, source_sku, source_id, pf_listing_id, pf_global_listing_id <br />
    012+ <th>ref</th>
    013- FROM t_listing_mercadolibre <br />
    013+ <th>rows</th>
    014- WHERE source_id = 10833 AND status IN (1, 3) AND is_deleted = 0 <br />
    014+ <th>filtered</th>
    015- ORDER BY id ASC <br />
    015+ <th>Extra</th>
    016- LIMIT 200;<br />
    016+ </tr></tbody><tbody><tr><td>1</td>
    017- <br />
    017+ <td>SIMPLE</td>
    018- <br />
    018+ <td>t_listing_mercadolibre</td>
    019- 建议创建以下复合索引以提升查询性能:<br />
    019+ <td>None</td>
    020- <br />
    020+ <td>index</td>
    021- <br />
    021+ <td>uk_source_id_country_code_pf_listing_logistic_type_platform_type,idx_status,idx_source_id_update_time,idx_source_site_status,IDX_is_deleted_source_id_status_id</td>
    022- CREATE INDEX idx_listing_mercadolibre_optim ON t_listing_mercadolibre(source_id, status, is_deleted, id);<br />
    022+ <td>PRIMARY</td>
    023- <br />
    023+ <td>8</td>
    024- <br />
    024+ <td>None</td>
    025- 这个复合索引能够覆盖WHERE条件和ORDER BY子句,可以显著提高查询效率。<br />
    025+ <td>38139</td>
    026- explain表:<br />
    026+ <td>0.1</td>
    027- <br />
    027+ <td>Using where</td>
    028- <br />
    028+ </tr></tbody></table><br />
    029- <br />
    029+ 额外建议:<br /> 索引建议:<br /> 取出表 【t_listing_mercadolibre】 where条件字段 【status】 100000 条记录,重复的数据有:【100000】 条,没有必要为该字段创建索引。<br /><br /> 取出表 【t_listing_mercadolibre】 where条件字段 【is_deleted】 100000 条记录,重复的数据有:【100000】 条,没有必要为该字段创建索引。<br /><br /><span style="color:#008000;font-weight:bold;">→ 【t_listing_mercadolibre】表 【source_id,id】字段,联合索引已经存在,无需添加任何索引。</span><br /><br /> 【t_listing_mercadolibre】表 【source_id,id】字段,索引分析:<br /> +------------------------+--------------------------------+---------------+---------------+<br /> | TABLE_NAME | INDEX_NAME | COLUMN_NAME | CARDINALITY |<br /> +========================+================================+===============+===============+<br /> | t_listing_mercadolibre | IDX_is_deleted_source_id_statu | id | 8278215 |<br /> | | s_id | | |<br /> +------------------------+--------------------------------+---------------+---------------+<br /> | t_listing_mercadolibre | IDX_is_deleted_source_id_statu | source_id | 18240 |<br /> | | s_id | | |<br /> +------------------------+--------------------------------+---------------+---------------+<br /> | t_listing_mercadolibre | idx_sku | source_id | 4267993 |<br /> +------------------------+--------------------------------+---------------+---------------+<br /> | t_listing_mercadolibre | idx_source_id_update_time | source_id | 15164 |<br /> +------------------------+--------------------------------+---------------+---------------+<br /> | t_listing_mercadolibre | idx_source_site_status | source_id | 20112 |<br /> +------------------------+--------------------------------+---------------+---------------+<br /> | t_listing_mercadolibre | PRIMARY | id | 8278215 |<br /> +------------------------+--------------------------------+---------------+---------------+<br /> | t_listing_mercadolibre | uk_source_id_country_code_pf_l | source_id | 13723 |<br /> | | isting_logistic_type_platform_ | | |<br /> | | type | | |<br /> +------------------------+--------------------------------+---------------+---------------+<br /><br /><p>问题2:</p>
    030- <br />
    030+ <p><span style="color:#000000;">数据库:zhcxkj_center_listing_comprehensive</span><br /><span style="color:#000000;">查询时间:14.3059</span><br /><span style="color:#000000;">扫描行数:336699</span><br /><span style="color:#000000;">发送行数:1</span><br /><span style="color:#000000;">指纹SQL: SELECT COUNT ( * ) FROM ? WHERE ( source_id = ? AND country_code = ? AND logistic_type = ? AND status IN ( ? ) ) ;</span><br /><span style="color:#000000;">真实SQL:SELECT COUNT( * ) FROM t_listing_mercadolibre WHERE (source_id = 28058 AND country_code = MLB AND logistic_type = remote AND status IN (3));</span><br /><span style="color:#000000;">王凯,人工修改过</span><br /><span style="color:#000000;">AISQL修改建议:CREATE INDEX idx_listing_optim ON t_listing_mercadolibre(source_id, country_code, logistic_type, status);</span><br /><span style="color:#000000;">explain表:</span><br /><br /><br /><br /><br /><br /><br /></p><table><tbody><tr><th>id</th>
    031- <br />
    031+ <th>select_type</th>
    032- <br />
    032+ <th>table</th>
    033- <table>
    033+ <th>partitions</th>
    034- <tbody>
    034+ <th>type</th>
    035- <tr>
    035+ <th>possible_keys</th>
    036- <th>
    036+ <th>key</th>
    037- id
    037+ <th>key_len</th>
    038- </th>
    038+ <th>ref</th>
    039- <th>
    039+ <th>rows</th>
    040- select_type
    040+ <th>filtered</th>
    041- </th>
    041+ <th>Extra</th>
    042- <th>
    042+ </tr></tbody><tbody><tr><td style="font-size:12px;">1</td>
    043- table
    043+ <td style="font-size:12px;">SIMPLE</td>
    044- </th>
    044+ <td style="font-size:12px;">t_listing_mercadolibre</td>
    045- <th>
    045+ <td style="font-size:12px;">None</td>
    046- partitions
    046+ <td style="font-size:12px;">ref</td>
    047- </th>
    047+ <td style="font-size:12px;">uk_source_id_country_code_pf_listing_logistic_type_platform_type,idx_status,idx_source_id_update_time,idx_source_site_status</td>
    048- <th>
    048+ <td style="font-size:12px;">idx_source_site_status</td>
    049- type
    049+ <td style="font-size:12px;">56</td>
    050- </th>
    050+ <td style="font-size:12px;">const,const,const</td>
    051- <th>
    051+ <td style="font-size:12px;">618074</td>
    052- possible_keys
    052+ <td style="font-size:12px;">10</td>
    053- </th>
    053+ <td style="font-size:12px;">Using where</td>
    054- <th>
    054+ </tr></tbody></table><br /><span style="color:#000000;">额外建议:</span><br /><span style="color:#000000;">索引建议:</span><br />
    055- key
    056- </th>
    057- <th>
    058- key_len
    059- </th>
    060- <th>
    061- ref
    062- </th>
    063- <th>
    064- rows
    065- </th>
    066- <th>
    067- filtered
    068- </th>
    069- <th>
    070- Extra
    071- </th>
    072- </tr>
    073- </tbody>
    074- <tbody>
    075- <tr>
    076- <td>
    077- 1
    078- </td>
    079- <td>
    080- SIMPLE
    081- </td>
    082- <td>
    083- t_listing_mercadolibre
    084- </td>
    085- <td>
    086- None
    087- </td>
    088- <td>
    089- index
    090- </td>
    091- <td>
    092- uk_source_id_country_code_pf_listing_logistic_type_platform_type,idx_status,idx_source_id_update_time,idx_source_site_status,IDX_is_deleted_source_id_status_id
    093- </td>
    094- <td>
    095- PRIMARY
    096- </td>
    097- <td>
    098- 8
    099- </td>
    100- <td>
    101- None
    102- </td>
    103- <td>
    104- 38139
    105- </td>
    106- <td>
    107- 0.1
    108- </td>
    109- <td>
    110- Using where
    111- </td>
    112- </tr>
    113- </tbody>
    114- </table>
    115- <br />
    116- 额外建议:<br />
    117- 索引建议:<br />
    118- 取出表 【t_listing_mercadolibre】 where条件字段 【status】 100000 条记录,重复的数据有:【100000】 条,没有必要为该字段创建索引。<br />
    119- <br />
    120- 取出表 【t_listing_mercadolibre】 where条件字段 【is_deleted】 100000 条记录,重复的数据有:【100000】 条,没有必要为该字段创建索引。<br />
    121- <br />
    122- <span style="color:green;font-weight:bold;">→ 【t_listing_mercadolibre】表 【source_id,id】字段,联合索引已经存在,无需添加任何索引。</span><br />
    123- <br />
    124- 【t_listing_mercadolibre】表 【source_id,id】字段,索引分析:<br />
    125- +------------------------+--------------------------------+---------------+---------------+<br />
    126- | TABLE_NAME | INDEX_NAME | COLUMN_NAME | CARDINALITY |<br />
    127- +========================+================================+===============+===============+<br />
    128- | t_listing_mercadolibre | IDX_is_deleted_source_id_statu | id | 8278215 |<br />
    129- | | s_id | | |<br />
    130- +------------------------+--------------------------------+---------------+---------------+<br />
    131- | t_listing_mercadolibre | IDX_is_deleted_source_id_statu | source_id | 18240 |<br />
    132- | | s_id | | |<br />
    133- +------------------------+--------------------------------+---------------+---------------+<br />
    134- | t_listing_mercadolibre | idx_sku | source_id | 4267993 |<br />
    135- +------------------------+--------------------------------+---------------+---------------+<br />
    136- | t_listing_mercadolibre | idx_source_id_update_time | source_id | 15164 |<br />
    137- +------------------------+--------------------------------+---------------+---------------+<br />
    138- | t_listing_mercadolibre | idx_source_site_status | source_id | 20112 |<br />
    139- +------------------------+--------------------------------+---------------+---------------+<br />
    140- | t_listing_mercadolibre | PRIMARY | id | 8278215 |<br />
    141- +------------------------+--------------------------------+---------------+---------------+<br />
    142- | t_listing_mercadolibre | uk_source_id_country_code_pf_l | source_id | 13723 |<br />
    143- | | isting_logistic_type_platform_ | | |<br />
    144- | | type | | |<br />
    145- +------------------------+--------------------------------+---------------+---------------+<br />
    146- <br />
    147- <br />
  3. 2025-08-12 09:23:45, 由 任芳涛 指派给 陈莉珍。
    修改了 指派给,旧值为 "renfangtao",新值为 "chenlizhen"。
  4. 2025-08-12 09:25:52, 由 陈莉珍 指派给 蔡俊伟。
    修改了 指派给,旧值为 "chenlizhen",新值为 "caijunwei"。
  5. 2025-08-12 14:13:33, 由 蔡俊伟 解决,方案为 性能问题 。
    修改了 解决方案,旧值为 "",新值为 "performance"。
    修改了 解决版本,旧值为 "",新值为 "trunk"。
    修改了 解决日期,旧值为 "",新值为 "2025-08-12 14:10:55"。
    修改了 指派给 ,旧值为 "caijunwei",新值为 "chenlizhen"。
    修改了 Bug状态 ,旧值为 "active",新值为 "resolved"。
    修改了 是否确认,旧值为 "0",新值为 "1"。
    修改了 解决者 ,旧值为 "",新值为 "caijunwei"。

    已解决    后续要去掉oder by Id

  6. 2025-08-12 14:58:13, 由 陈莉珍 编辑。
    修改了 开发责任人,旧值为 "",新值为 "caijunwei"。
    修改了 测试责任人,旧值为 "",新值为 "caijunwei"。
    修改了 解决时效 ,旧值为 "0",新值为 "5.10"。
    修改了 上线时间 ,旧值为 "0000-00-00 00:00:00",新值为 "2025-08-12 14:10"。
    修改了 上线时效 ,旧值为 "-1",新值为 "5.09"。
    修改了 重现步骤 ,区别为:
    030- 数据库:zhcxkj_center_listing_comprehensive查询时间:14.3059扫描行数:336699发送行数:1指纹SQL: SELECT COUNT ( * ) FROM ? WHERE ( source_id = ? AND country_code = ? AND logistic_type = ? AND status IN ( ? ) ) ;真实SQL:SELECT COUNT( * ) FROM t_listing_mercadolibre WHERE (source_id = 28058 AND country_code = MLB AND logistic_type = remote AND status IN (3));王凯,人工修改过AISQL修改建议:CREATE INDEX idx_listing_optim ON t_listing_mercadolibre(source_id, country_code, logistic_type, status);explain表:id
    030+ 数据库:zhcxkj_center_listing_comprehensive查询时间:14.3059扫描行数:336699发送行数:1指纹SQL: SELECT COUNT ( * ) FROM ? WHERE ( source_id = ? AND country_code = ? AND logistic_type = ? AND status IN ( ? ) ) ;真实SQL:SELECT COUNT( * ) FROM t_listing_mercadolibre WHERE (source_id = 28058 AND country_code = MLB AND logistic_type = remote AND status IN (3));王凯,人工修改过AISQL修改建议:CREATE INDEX idx_listing_optim ON t_listing_mercadolibre(source_id, country_code, logistic_type, status);explain表:
    031- select_type
    031+ id
    032- table
    032+ select_type
    033- partitions
    033+ table
    034- type
    034+ partitions
    035- possible_keys
    035+ type
    036- key
    036+ possible_keys
    037- key_len
    037+ key
    038- ref
    038+ key_len
    039- rows
    039+ ref
    040- filtered
    040+ rows
    041- Extra
    041+ filtered
    042- 1
    042+ Extra
    043- SIMPLE
    043+ 1
    044- t_listing_mercadolibre
    044+ SIMPLE
    045- None
    045+ t_listing_mercadolibre
    046- ref
    046+ None
    047- uk_source_id_country_code_pf_listing_logistic_type_platform_type,idx_status,idx_source_id_update_time,idx_source_site_status
    047+ ref
    048- idx_source_site_status
    048+ uk_source_id_country_code_pf_listing_logistic_type_platform_type,idx_status,idx_source_id_update_time,idx_source_site_status
    049- 56
    049+ idx_source_site_status
    050- const,const,const
    050+ 56
    051- 618074
    051+ const,const,const
    052- 10
    052+ 618074
    053- Using where
    053+ 10
    054- 额外建议:索引建议:
    054+ Using where
    055+ 额外建议:索引建议:
    030- <p><span style="color:#000000;">数据库:zhcxkj_center_listing_comprehensive</span><br /><span style="color:#000000;">查询时间:14.3059</span><br /><span style="color:#000000;">扫描行数:336699</span><br /><span style="color:#000000;">发送行数:1</span><br /><span style="color:#000000;">指纹SQL: SELECT COUNT ( * ) FROM ? WHERE ( source_id = ? AND country_code = ? AND logistic_type = ? AND status IN ( ? ) ) ;</span><br /><span style="color:#000000;">真实SQL:SELECT COUNT( * ) FROM t_listing_mercadolibre WHERE (source_id = 28058 AND country_code = MLB AND logistic_type = remote AND status IN (3));</span><br /><span style="color:#000000;">王凯,人工修改过</span><br /><span style="color:#000000;">AISQL修改建议:CREATE INDEX idx_listing_optim ON t_listing_mercadolibre(source_id, country_code, logistic_type, status);</span><br /><span style="color:#000000;">explain表:</span><br /><br /><br /><br /><br /><br /><br /></p><table><tbody><tr><th>id</th>
    030+ <p><span style="color:#000000;">数据库:zhcxkj_center_listing_comprehensive</span><br /><span style="color:#000000;">查询时间:14.3059</span><br /><span style="color:#000000;">扫描行数:336699</span><br /><span style="color:#000000;">发送行数:1</span><br /><span style="color:#000000;">指纹SQL: SELECT COUNT ( * ) FROM ? WHERE ( source_id = ? AND country_code = ? AND logistic_type = ? AND status IN ( ? ) ) ;</span><br /><span style="color:#000000;">真实SQL:SELECT COUNT( * ) FROM t_listing_mercadolibre WHERE (source_id = 28058 AND country_code = MLB AND logistic_type = remote AND status IN (3));</span><br /><span style="color:#000000;">王凯,人工修改过</span><br /><span style="color:#000000;">AISQL修改建议:CREATE INDEX idx_listing_optim ON t_listing_mercadolibre(source_id, country_code, logistic_type, status);</span><br /><span style="color:#000000;">explain表:</span><br /><br /><br /><br /><br /></p>
    031- <th>select_type</th>
    031+ <table><tbody><tr><th>id</th>
    032- <th>table</th>
    032+ <th>select_type</th>
    033- <th>partitions</th>
    033+ <th>table</th>
    034- <th>type</th>
    034+ <th>partitions</th>
    035- <th>possible_keys</th>
    035+ <th>type</th>
    036- <th>key</th>
    036+ <th>possible_keys</th>
    037- <th>key_len</th>
    037+ <th>key</th>
    038- <th>ref</th>
    038+ <th>key_len</th>
    039- <th>rows</th>
    039+ <th>ref</th>
    040- <th>filtered</th>
    040+ <th>rows</th>
    041- <th>Extra</th>
    041+ <th>filtered</th>
    042- </tr></tbody><tbody><tr><td style="font-size:12px;">1</td>
    042+ <th>Extra</th>
    043- <td style="font-size:12px;">SIMPLE</td>
    043+ </tr></tbody><tbody><tr><td style="font-size:12px;">1</td>
    044- <td style="font-size:12px;">t_listing_mercadolibre</td>
    044+ <td style="font-size:12px;">SIMPLE</td>
    045- <td style="font-size:12px;">None</td>
    045+ <td style="font-size:12px;">t_listing_mercadolibre</td>
    046- <td style="font-size:12px;">ref</td>
    046+ <td style="font-size:12px;">None</td>
    047- <td style="font-size:12px;">uk_source_id_country_code_pf_listing_logistic_type_platform_type,idx_status,idx_source_id_update_time,idx_source_site_status</td>
    047+ <td style="font-size:12px;">ref</td>
    048- <td style="font-size:12px;">idx_source_site_status</td>
    048+ <td style="font-size:12px;">uk_source_id_country_code_pf_listing_logistic_type_platform_type,idx_status,idx_source_id_update_time,idx_source_site_status</td>
    049- <td style="font-size:12px;">56</td>
    049+ <td style="font-size:12px;">idx_source_site_status</td>
    050- <td style="font-size:12px;">const,const,const</td>
    050+ <td style="font-size:12px;">56</td>
    051- <td style="font-size:12px;">618074</td>
    051+ <td style="font-size:12px;">const,const,const</td>
    052- <td style="font-size:12px;">10</td>
    052+ <td style="font-size:12px;">618074</td>
    053- <td style="font-size:12px;">Using where</td>
    053+ <td style="font-size:12px;">10</td>
    054- </tr></tbody></table><br /><span style="color:#000000;">额外建议:</span><br /><span style="color:#000000;">索引建议:</span><br />
    054+ <td style="font-size:12px;">Using where</td>
    055+ </tr></tbody></table><br /><span style="color:#000000;">额外建议:</span><br /><span style="color:#000000;">索引建议:</span><br />
  7. 2025-08-12 14:58:16, 由 陈莉珍 关闭。
    修改了 Bug状态 ,旧值为 "resolved",新值为 "closed"。
    修改了 指派给 ,旧值为 "chenlizhen",新值为 "closed"。
    修改了 由谁关闭,旧值为 "",新值为 "chenlizhen"。
    修改了 关闭日期,旧值为 "",新值为 "2025-08-12 14:58:16"。
所属项目 技术中心-需求池
所属模块 多平台   mercado
所属计划
所属迭代
Bug类型
严重程度 一般
优先级 P2
Bug状态 已关闭
业务部门 总经办
影响功能
开发责任人 蔡俊伟
测试责任人 蔡俊伟
解决时效 5.1
激活次数 0
激活日期
是否确认 是
当前指派 Closed 于 2025-08-12 14:58:16
截止日期 0000-00-00
上线时间 2025-08-12 14:10:00
上线时效 5.09
操作系统
浏览器
关键词
抄送给
所属迭代
相关需求
相关任务
由谁创建 陈莉珍 于 2025-08-12 09:04:47
影响环境 生产环境-业务反馈
由谁解决 蔡俊伟 于 2025-08-12 14:10:55
解决版本 主干
解决方案 性能问题
由谁关闭 陈莉珍 于 2025-08-12 14:58:16
最后修改 陈莉珍 于 2025-08-12 14:58:16
相关Bug