|数据库名称|SQL语句|总执行次数|总执行时间(秒)|最大执行时长|平均执行时间|锁定总时长|最大锁定时长|解析总行数|解析最大行数|返回总行数|返回最大行数|
| - | - | - | - | - | - | - | - | - | - | - | - |
|v4_user|SELECT t.shop_id,t.shop_name,count(DISTINCT t.id) AS couponNum,ifnull(sum(es.amount_pay),?) AS saleAmount FROM v4_coupon.coupon_write_off t LEFT JOIN v4_sales.erp_sales_detail es ON es.tenant_id=? AND es.tenant_app_id=? AND t.business_id=es.sales_erp_id WHERE t.tenant_id=? AND t.tenant_app_id=? AND t.shop_id>? AND t.create_time>=? AND t.create_time<? GROUP BY t.shop_id,t.shop_name|1|1|1||0|0|70|70|0|0|
|v4_user|SELECT * FROM `member_butler_back`|1|3|3||0|0|372098|372098|372098|372098|
|sms|SELECT * FROM `sms_send`|1|1002|1002||0|0|9367232|9367232|9367232|9367232|
|account|SELECT min(create_time)create_time FROM coupon_service.template WHERE tenant_id=? AND tenant_app_id=?|1|1|1||0|0|22078|22078|1|1|
|payment|SELECT * FROM `refund_order_msg`|1|1|1||0|0|14263|14263|14263|14263|
|account|SELECT es.tenant_id,es.tenant_wechatapp_id tenant_app_id,es.member_erp_id,es.sales_erp_id lastSaleErpId,sd.category_erp_id lastCategoryId,ifnull(pc.category_name,sd.category_name) AS lastCategoryName,sd.stone_weight lastStoneWeight,sd.gold_weight lastGoldWeight,round(sd.amount_pay/if(sd.quantity=?,?,sd.quantity),?)price,sd.amount_pay salesBalance FROM tenant.erp_sales es INNER JOIN tenant.erp_sales_detail sd ON sd.tenant_id=es.tenant_id AND es.tenant_wechatapp_id=sd.tenant_wechatapp_id AND es.sales_erp_id=sd.sales_erp_id LEFT JOIN tenant.erp_product_category pc ON es.tenant_id=pc.tenant_id AND sd.category_erp_id=pc.category_erp_id WHERE es.tenant_id=? AND es.tenant_wechatapp_id=? AND es.member_erp_id=? AND es.sales_date>=? AND es.sales_status=? AND es.is_sales=? AND sd.sales_type=? ORDER BY es.sales_erp_id DESC,price DESC LIMIT ?|1|1|1||0|0|127|127|1|1|
|tenant|SELECT * FROM `employee_shop`|1|2|2||0|0|93414|93414|93414|93414|
|employee|SELECT * FROM `backlog_detail`|1|7|7||0|0|1429463|1429463|1429463|1429463|
|export|SELECT c.id,c.coupon_no,ce.member_name,ce.mobile_no,c.type AS couponType,c.member_id,ce.coupon_name,c.scene,c.begin_time,c.end_time,c.coupon_status status,s.name shopName,round(c.face_value/?,?) AS faceValue,round(c.face_value/?,?) AS points,cwo.employee_id AS writeOffEmployeeId,cwo.shop_id AS writeOffShopId,ce.write_off_time writeOffTime,cwo.business_id writeOffBusinessId FROM v4_coupon.coupon c JOIN v4_coupon.coupon_extend ce ON ce.tenant_id=? AND ce.tenant_app_id=? AND ce.id=c.id JOIN v4_user.member m ON m.tenant_id=? AND m.tenant_app_id=? AND m.id=c.member_id LEFT JOIN v4_employee.shop s ON s.tenant_id=? AND s.tenant_app_id=? AND s.id=m.shop_id LEFT JOIN v4_coupon.coupon_write_off cwo ON cwo.tenant_id=? AND cwo.tenant_app_id=? AND cwo.coupon_id=c.id AND cwo.status=? WHERE c.tenant_id=? AND c.tenant_app_id=? AND ce.coupon_name LIKE CONCAT(?,?,?) AND c.coupon_status IN (?)|1|14|14||0|0|602571|602571|1095|1095|
|v4_user|SELECT * FROM `wx_user`|1|45|45||0|0|5282711|5282711|5282711|5282711|
|v4_user|SELECT DATE_FORMAT(tt?.recept_time,?) AS statistic_date,DATE_FORMAT(tt?.recept_time,?) AS statistic_month,tt?.tenant_id,tt?.tenant_app_id,tt?.shop_id,tt?.employee_id,tt?.fieldName,tt?.fieldValue,count(*) AS total FROM (SELECT t?.recept_time,t?.tenant_id,t?.tenant_app_id,t?.shop_id,t?.employee_id,? AS fieldName,TRIM(? FROM JSON_EXTRACT(t?.checkin_labels,concat(SUBSTRING(TRIM(? FROM JSON_SEARCH(t?.checkin_labels,?,?)),?,LOCATE(?,TRIM(? FROM JSON_SEARCH(t?.checkin_labels,?,?)))-?),?))) AS fieldValue FROM v4_user.reception_customer t? WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.create_time>=? AND t?.create_time<? AND JSON_CONTAINS(t?.checkin_labels,JSON_OBJECT(?,?)))tt? GROUP BY DATE_FORMAT(tt?.recept_time,?),DATE_FORMAT(tt?.recept_time,?),tt?.tenant_id,tt?.tenant_app_id,tt?.shop_id,tt?.employee_id,tt?.fieldName,tt?.fieldValue|1|4|4||0|0|23403|23403|40|40|
|shop_work|SELECT * FROM `task_old`|1|1|1||0|0|3211|3211|3211|3211|
|shop_work|SELECT * FROM `manage_report`|1|1|1||0|0|662|662|662|662|
|v4_user|SELECT * FROM `member`|1|78|78||0|0|4080167|4080167|4080167|4080167|
|v4_user|SELECT t?.tenant_id,t?.tenant_app_id,t?.shop_id,t?.employee_id,? AS statisticDate,? AS bizType,count(*) AS amount FROM v4_employee.task_task t? WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.task_type=? AND t?.finish_time>=? AND t?.finish_time<? GROUP BY t?.tenant_id,t?.tenant_app_id,t?.shop_id,t?.employee_id LIMIT ? OFFSET ?|1|1|1||0|0|5317|5317|0|0|
|tenant|SELECT * FROM `erp_employee`|1|5|5||0|0|88399|88399|88399|88399|
|shop_work|SELECT * FROM `task`|1|97|97||0|0|464505|464505|464505|464505|
|account|SELECT t.tenant_id,t.tenant_app_id,t.shop_id,t.user_id,t.scene,t.busi_date,count(*)finish_amount FROM (SELECT bg.id,bg.tenant_id,bg.tenant_app_id,ifnull(ws.dept_erp_id,?)shop_id,ifnull(ey.employee_erp_id,?)user_id,bg.status,bg.scene,date_format(bg.expire_time,?)busi_date FROM employee.backlog_? bg INNER JOIN tenant.tenant_wechatapp_shop ws ON bg.shop_id=ws.id INNER JOIN tenant.employee ey ON bg.employee_id=ey.id WHERE bg.tenant_app_id=? AND bg.status IN (?) AND bg.scene NOT IN(?) AND bg.finish_time>=? AND bg.finish_time<=?)t GROUP BY t.tenant_id,t.tenant_app_id,t.shop_id,t.user_id,t.scene,t.busi_date LIMIT ? OFFSET ?|1|1|1||0|0|6099|6099|789|789|
|account|SELECT esd.id,es.tenant_id,es.tenant_wechatapp_id AS tenantAppId,es.sales_erp_id,esd.sales_index,es.dept_erp_id,es.employee_erp_id,es.member_erp_id,es.sales_status,es.sales_date,esd.category_erp_id,ifnull(esde.sales_brand,?) AS sales_brand,ifnull(esde.sales_craft,?) AS sales_craft,esd.amount_total,esd.amount_pay,esd.quantity,round(esd.amount_pay/esd.quantity,?) AS amount_avg FROM tenant.erp_sales es JOIN tenant.erp_sales_detail esd ON es.tenant_id=esd.tenant_id AND es.tenant_wechatapp_id=esd.tenant_wechatapp_id AND es.sales_erp_id=esd.sales_erp_id AND esd.sales_type=? LEFT JOIN tenant.erp_sales_detail_extend esde ON esde.tenant_id=esd.tenant_id AND esde.tenant_wechatapp_id=esd.tenant_wechatapp_id AND esde.sales_erp_id=esd.sales_erp_id AND esde.sales_index=esd.sales_index WHERE es.tenant_id=? AND es.tenant_wechatapp_id=? AND es.update_time>=? AND es.update_time<=? AND es.sales_status IN(?) LIMIT ? OFFSET ?|1|1|1||0|0|0|0|0|0|
|export|SELECT bg.id,bg.employee_id,bg.shop_id,CASE bg.scene WHEN ? THEN ? ELSE ? END scene,CASE bg.status WHEN ? THEN ? ELSE ? END status,bg.create_time,bg.begin_time,bg.expire_time,bg.member_user_name,bg.mobile_no member_mobile_no,ws.shop_name,ey.employee_name userName,ey.mobile_no FROM employee.backlog_? bg LEFT JOIN tenant.tenant_wechatapp_shop ws ON bg.shop_id=ws.id LEFT JOIN tenant.employee ey ON bg.employee_id=ey.id WHERE bg.tenant_app_id=? AND bg.scene NOT IN(?) AND bg.expire_time BETWEEN ? AND ? AND bg.shop_id=? AND bg.leave_flag=? ORDER BY bg.id DESC|1|7|7||0|0|43458|43458|834|834|
|export|SELECT pc.id,pc.cutomer_grade AS cutomerGrade,ifnull(mem.member_name,ifnull(eu.external_user_name,?)) AS `name`,mem.mobile_no,pc.maintain_employee_name AS maintainEmployee,pc.last_maintain_time,(CASE WHEN pc.`status`=? THEN pc.finish_time ELSE ? END)dealTime,pc.maintain_num AS maintainNum,pc.intention_num,pc.latest_intention,sp.`name` AS maintainShop,pc.`status`,(CASE pc.`status` WHEN ? THEN ? ELSE ? END) AS statusName,pc.fail_employee_name AS failEmployee,pc.checkin_time,pc.finish_time AS finishTime FROM v4_user.potential_customer pc LEFT JOIN (SELECT t?.tenant_id,ifnull(t?.member_name,t?.external_user_name) AS external_user_name,t?.external_user_id FROM v4_user.cwx_external_user t? LEFT JOIN v4_user.member t? ON t?.tenant_id=? AND t?.tenant_app_id=? AND t?.external_user_id=t?.external_user_id WHERE t?.tenant_id=?)eu ON pc.tenant_id=eu.tenant_id AND pc.external_user_id=eu.external_user_id LEFT JOIN v4_user.member mem ON pc.tenant_id=mem.tenant_id AND pc.member_id=mem.id AND mem.`status`=? LEFT JOIN v4_employee.shop sp ON pc.maintain_shop_id=sp.id WHERE pc.tenant_id=? AND pc.tenant_app_id=? AND EXISTS (SELECT ? FROM v4_user.potential_customer_maintain t? WHERE pc.id=t?.potential_customer_id AND t?.create_time>=? AND t?.create_time<=? AND t?.event_type IN(?)) ORDER BY pc.id DESC|1|1|1||0|0|6928|6928|229|229|
|qrcode_service|SELECT * FROM `qrcode`|1|7|7||0|0|77464|77464|77464|77464|
|qrcode_login|SELECT * FROM `qrcode_log`|1|1|1||0|0|7951|7951|7951|7951|
|account|SELECT u.id,u.tenant_id,u.tenant_app_id,tw.dept_erp_id AS shop_id,date_format(u.birthday,?) AS tempBirthDay,ifnull(u.birthday_is_lunar,?) AS birthdayIsLunar,u.memorial_name,date_format(u.memorial_day,?) AS tempMemorialDay,ifnull(u.memorial_day_is_lunar,?) AS memorialDayIsLunar,u.grade_id AS gradeErpId,if(u.birthday IS ?,?,?) AS fullFlag FROM user_service.tenant_member_info u LEFT JOIN tenant.tenant_wechatapp_shop tw ON u.shop_id=tw.id WHERE u.tenant_id=? AND u.tenant_app_id=? AND u.update_time>=? AND u.update_time<=? ORDER BY u.tenant_id,u.id LIMIT ? OFFSET ?|1|6|6||0|0|9939|9939|3313|3313|
|account|SELECT pd.id product_id,? tenant_id,? tenant_wechatapp_id,pd.product_name,? product_type,pd.tag_price price,it.volume,it.id inventory_id,pd.create_time,? partner_id,? partner_name,pd.update_time FROM gift_mail.platform_product pd LEFT JOIN gift_mail.platform_inventory it ON pd.id=it.product_id LIMIT ? OFFSET ?|1|2|2||0|0|4366|4366|2183|2183|
|account|SELECT es.tenant_id,es.tenant_wechatapp_id tenant_app_id,es.member_erp_id,ifnull(group_concat(DISTINCT if(es.sales_status=?,sd.category_erp_id,?)),?)categoryId,ifnull(group_concat(DISTINCT if(es.sales_status=?,ifnull(pc.category_name,sd.category_name),?)),?) AS categoryName,min(if(es.sales_status=?,es.sales_date,?)) AS firstSalesTime,max(if(es.sales_status=?,es.sales_date,?)) AS lastSalesTime FROM tenant.erp_sales es INNER JOIN tenant.erp_sales_detail sd ON sd.tenant_id=es.tenant_id AND es.tenant_wechatapp_id=sd.tenant_wechatapp_id AND es.sales_erp_id=sd.sales_erp_id AND sd.sales_type=? LEFT JOIN tenant.erp_product_category pc ON es.tenant_id=pc.tenant_id AND sd.category_erp_id=pc.category_erp_id WHERE es.tenant_id=? AND es.tenant_wechatapp_id=? AND es.is_sales=? AND es.sales_status>=? AND es.member_erp_id IN|1|42|42||0|0|31187|31187|500|500|
|v4_user|SELECT * FROM `employee_external_bind`|1|40|40||0|0|7060038|7060038|7060038|7060038|
|account|SELECT tenant_wechatapp_id tenant_app_id,member_erp_id FROM tenant.erp_sales WHERE tenant_id=? AND tenant_wechatapp_id=? AND update_time BETWEEN ? AND ? GROUP BY tenant_wechatapp_id,member_erp_id LIMIT ? OFFSET ?|1|1|1||0|0|216|216|2|2|
|account|SELECT t?.id,t?.tenant_id,t?.tenant_app_id,t?.sneak_guest_no,ifnull(tb.erp_member_id,?) AS memberId,(CASE t?.user_type WHEN ? THEN ? ELSE ? END) AS userType,ifnull(tm.user_name,ceu.nick_name) AS userName,tm.mobile_no,t?.create_employee_id,t?.create_shop_id,t?.create_time AS recordTime,t?.maintain_employee_id,t?.last_maintain_date,(CASE t?.`status` WHEN ? THEN ? ELSE ? END)`status`,t?.sales_erp_id,if(t?.`status`=?,t?.update_employee_id,?) AS failEmployeeId,(CASE fail_type WHEN ? THEN ? ELSE ? END) AS failType,t?.finish_date FROM tenant.sneak_guest t? LEFT JOIN user_service.tenant_member tm ON tm.tenant_id=? AND tm.tenant_app_id=t?.tenant_app_id AND tm.user_id=t?.user_id LEFT JOIN user_service.tenant_member_bind tb ON tb.tenant_id=? AND tb.id=tm.id LEFT JOIN corpwx.corpwx_external_user ceu ON t?.user_id=ceu.id LEFT JOIN tenant.sneak_guest_sales t? ON t?.tenant_id=t?.tenant_id AND t?.id=t?.sneak_guest_id LEFT JOIN tenant.erp_sales t? ON t?.tenant_id=t?.tenant_id AND t?.sales_id=t?.id AND t?.tenant_wechatapp_id=? WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.update_time>=? AND t?.update_time<=? LIMIT ? OFFSET ?|1|1|1||0|0|1542|1542|257|257|
|sms|SELECT * FROM `sms_send_back`|1|2|2||0|0|16036|16036|16036|16036|
|v4_user|SELECT * FROM `reception_customer_potential`|1|22|22||0|0|5339436|5339436|5339436|5339436|
|v4_user|SELECT t?.tenant_id,t?.tenant_app_id,DATE_FORMAT(t?.recept_time,?) AS statistic_date,DATE_FORMAT(t?.recept_time,?) AS statistic_month,DATE_FORMAT(t?.recept_time,?) AS `hour`,DATE_FORMAT(t?.create_time,?) AS busi_date,t?.shop_id,count(*) AS total FROM v4_user.reception_customer t? WHERE t?.tenant_id=? AND t?.tenant_app_id=? AND t?.create_time>=? AND t?.create_time<? GROUP BY t?.tenant_id,t?.tenant_app_id,DATE_FORMAT(t?.recept_time,?),DATE_FORMAT(t?.recept_time,?),DATE_FORMAT(t?.recept_time,?),DATE_FORMAT(t?.create_time,?),t?.shop_id LIMIT ? OFFSET ?|1|15|15||0|0|23413|23413|45|45|
|account|SELECT es.tenant_id,es.tenant_wechatapp_id tenant_app_id,es.sales_date,es.dept_erp_id,es.employee_erp_id erpEmployeeId,sd.category_erp_id,tu.id FROM tenant.erp_sales es LEFT JOIN tenant.erp_sales_detail sd ON es.tenant_id=sd.tenant_id AND es.tenant_wechatapp_id=sd.tenant_wechatapp_id AND es.sales_erp_id=sd.sales_erp_id LEFT JOIN user_service.tenant_user tu ON tu.tenant_id=es.tenant_id AND es.tenant_wechatapp_id=tu.tenant_app_id AND es.member_erp_id=tu.erp_member_id WHERE es.tenant_id=? AND es.tenant_wechatapp_id=? AND es.create_time>=? AND es.create_time<=? AND es.sales_status=? AND es.is_sales=? AND sd.sales_type=? ORDER BY es.id LIMIT ? OFFSET ?|1|1|1||0|0|679|679|179|179|
|v4_user|SELECT * FROM `member_butler_update_error`|1|26|26||0|0|1591768|1591768|1591768|1591768|
|score_player|SELECT * FROM `score_flow`|1|1|1||0|0|34499|34499|34499|34499|
|tenant|SELECT * FROM `employee_qrcode`|1|3|3||0|0|66944|66944|66944|66944|
