SELECT SUM(b.marketPrice) as total FROM ims_ewei_shop_member_postresume AS a INNER JOIN ims_ewei_shop_goods as b ON a.goodsid = b.id INNER JOIN ims_ewei_shop_member as c ON c.unionid = a.openid WHERE c.channel_code > 0 AND b.marketPrice > 0;
Time: 2025-01-11T02:01:26.977258Z
User@Host: duozhiwa[duozhiwa] @ [192.168.0.2] Id: 12774561
Query_time: 1.512624 Lock_time: 0.000072 Rows_sent: 1 Rows_examined: 606070
SET timestamp=1736560886; SELECT SUM(b.marketPrice) as total FROM ims_ewei_shop_member_postresume AS a inner JOIN ims_ewei_shop_goods as b ON a.goodsid = b.id inner JOIN ims_ewei_shop_member as c ON c.unionid = a.openid where c.channel_code > 0 and b.marketPrice >0;
Time: 2025-01-11T02:03:31.523135Z
User@Host: duozhiwa[duozhiwa] @ [192.168.0.2] Id: 12776129
Query_time: 1.171106 Lock_time: 0.000056 Rows_sent: 1 Rows_examined: 606090
Unionid和openid是varchar 50,channel_code是 php的uniqid生成的 postresume表进行了全表扫描有 60万数据,这个sql执行了1秒有没有什么好的优化方案