数据库:zhcxkj_center_listing_comprehensive
查询时间:13.892
扫描行数:118551
发送行数:49.4533
指纹SQL: SELECT id , product_id , pf_listing_id , sku , source_sku , source_id , source_name , category_name , title , brand , attribute_color , attribute_height , attribute_length , attribute_weight , attribute_width , manufacturer , ean , color , discount_price_country , discount_price_currency , discount_price , language , normal_price_country , normal_price_currency , price , vate_rate , status , original_status , package_weight , lead_time , stock_status , stock_value , description , image , is_variant , create_by , create_time , update_by , update_time , is_deleted FROM ? WHERE ( source_id = ? AND product_id IN ( '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' , '?' ) AND status = ? AND is_deleted = ? ) ;
真实SQL:SELECT id,product_id,pf_listing_id,sku,source_sku,source_id,source_name,category_name,title,brand,attribute_color,attribute_height,attribute_length,attribute_weight,attribute_width,manufacturer,ean,color,discount_price_country,discount_price_currency,discount_price,language,normal_price_country,normal_price_currency,price,vate_rate,status,original_status,package_weight,lead_time,stock_status,stock_value,description,image,is_variant,create_by,create_time,update_by,update_time,is_deleted FROM t_listing_variant_fruugo WHERE (source_id = 27742 AND product_id IN ('FG2399047-1750182481382-002','FG7220151-1750188240486-015','FG2882796-1750165702614-012','FG6797832-1750166134725-013','FG9302245-1750183539069-003','FG8732239-1750182560598-012','FG9712349-1750183503580-017','FG8425970-1750182524893-019','FG6205034-1750165684465-002','FG6382426-1750187600926-011','FG8258780-1750182498680-001','FG2111255-1750187465828-002','FG5971546-1750165701389-016','FG4094002-1750182363255-007','FG9682937-1750165920399-014','FG6999919-1750182739902-004','FG6027715-1750182379597-007','FG8788536-1750187933673-010','FG6054194-1750187430735-013','FG7775082-1750182555730-008','FG7569159-1750182542110-011','FG3171324-1750166147509-007','FG9315563-1750188347859-011','FG8563153-1750182293317-006','FG8554515-1750182963776-008','FG6318433-1750193940150-008','FG4028991-1750187874445-006','FG3548311-1750187567663-013','FG6449697-1750182394528-013','FG7989495-1750187567663-012','FG6252149-1750187530896-005','FG9315687-1750182979768-007','FG3485398-1750165754555-012','FG3509247-1750165933313-009','FG9489308-1750182513513-013','FG4478361-1750165715111-004','FG3393607-1750187532902-008','FG4698784-1750165702614-005','FG9515401-1750182640270-002','FG4867744-1750182530307-013','FG4188836-1750182379597-004','FG9841862-1750182319801-003','FG8964811-1750194278286-004','FG8793618-1750165920399-003','FG7911342-1750182363255-013','FG5100162-1750187465828-005','FG7297571-1750182338169-014','FG8120077-1750165701389-010','FG8525555-1750188614738-016','FG9677456-1750182987924-009') AND status = 3 AND is_deleted = 0);
##无人工修改##
AISQL修改建议:CREATE INDEX idx_fruugo_source_product_status ON t_listing_variant_fruugo(source_id, product_id, status, is_deleted);
SELECT id, product_id, pf_listing_id, sku, source_sku, source_id, source_name, category_name, title, brand, attribute_color, attribute_height, attribute_length, attribute_weight, attribute_width, manufacturer, ean, color, discount_price_country, discount_price_currency, discount_price, LANGUAGE, normal_price_country, normal_price_currency, price, vate_rate, status, original_status, package_weight, lead_time, stock_status, stock_value, description, image, is_variant, create_by, create_time, update_by, update_time, is_deleted
FROM t_listing_variant_fruugo
WHERE source_id = 27742
AND product_id IN ('FG2399047-1750182481382-002','FG7220151-1750188240486-015','FG2882796-1750165702614-012','FG6797832-1750166134725-013','FG9302245-1750183539069-003','FG8732239-1750182560598-012','FG9712349-1750183503580-017','FG8425970-1750182524893-019','FG6205034-1750165684465-002','FG6382426-1750187600926-011','FG8258780-1750182498680-001','FG2111255-1750187465828-002','FG5971546-1750165701389-016','FG4094002-1750182363255-007','FG9682937-1750165920399-014','FG6999919-1750182739902-004','FG6027715-1750182379597-007','FG8788536-1750187933673-010','FG6054194-1750187430735-013','FG7775082-1750182555730-008','FG7569159-1750182542110-011','FG3171324-1750166147509-007','FG9315563-1750188347859-011','FG8563153-1750182293317-006','FG8554515-1750182963776-008','FG6318433-1750193940150-008','FG4028991-1750187874445-006','FG3548311-1750187567663-013','FG6449697-1750182394528-013','FG7989495-1750187567663-012','FG6252149-1750187530896-005','FG9315687-1750182979768-007','FG3485398-1750165754555-012','FG3509247-1750165933313-009','FG9489308-1750182513513-013','FG4478361-1750165715111-004','FG3393607-1750187532902-008','FG4698784-1750165702614-005','FG9515401-1750182640270-002','FG4867744-1750182530307-013','FG4188836-1750182379597-004','FG9841862-1750182319801-003','FG8964811-1750194278286-004','FG8793618-1750165920399-003','FG7911342-1750182363255-013','FG5100162-1750187465828-005','FG7297571-1750182338169-014','FG8120077-1750165701389-010','FG8525555-1750188614738-016','FG9677456-1750182987924-009')
AND status = 3
AND is_deleted = 0;
explain表:
| id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | SIMPLE | t_listing_variant_fruugo | None | ref | idx_source_id_source_sku,idx_source_id_sku_status,idx_source_create_time | idx_source_create_time | 10 | const,const | 221678 | 5 | Using where |
额外建议:
索引建议:
取出表 【t_listing_variant_fruugo】 where条件字段 【source_id】 100000 条记录,重复的数据有:【100000】 条,没有必要为该字段创建索引。
取出表 【t_listing_variant_fruugo】 where条件字段 【status】 100000 条记录,重复的数据有:【82168】 条,没有必要为该字段创建索引。
取出表 【t_listing_variant_fruugo】 where条件字段 【is_deleted】 100000 条记录,重复的数据有:【100000】 条,没有必要为该字段创建索引。
建议添加索引:ALTER TABLE t_listing_variant_fruugo ADD INDEX idx_product_id(product_id);
【t_listing_variant_fruugo】表 【product_id】字段,索引分析:
+--------------+--------------+---------------+---------------+
| TABLE_NAME | INDEX_NAME | COLUMN_NAME | CARDINALITY |
+==============+==============+===============+===============+
+--------------+--------------+---------------+---------------+
已完成