mysql慢查询语句该如何优化
SELECT * FROM `x_order` LEFT JOIN x_goods ON x_goods.goods_id = x_order.order_goodsid WHERE `order_isdelete` = 0 AND `goods_type` = 0 GROUP BY order_no
PHPz2017-04-17 14:52:11
Build an index
order_isdelete goods_type order_no goods_id
Consider how to build an index to optimize the query for these fields.
阿神2017-04-17 14:52:11
Try not to use JOIN and migrate functions from SQL to code level processing
Index