In case you have your own slow SQL query, you can optimize it automatically here.
For the query above, the following recommendations will be helpful as part of the SQL tuning process.
You'll find 3 sections below:
ALTER TABLE `order_goods` ADD INDEX `order_goods_idx_order_id_goods_id` (`order_id`,`goods_id`);
ALTER TABLE `order_info` ADD INDEX `order_info_idx_order_status` (`order_status`);
SELECT
g.goods_id,
o.order_status,
SUM(IF(o.shipping_status = 0,
g.quantity,
0)) AS 'pending',
SUM(IF(o.shipping_status = 3,
g.quantity,
0)) AS 'picking',
SUM(IF(o.shipping_status = 5,
g.quantity,
0)) AS 'shipping'
FROM
order_info AS o
LEFT JOIN
order_goods AS g
ON g.order_id = o.order_id
WHERE
o.order_status IN (
1, 5, 6
)
GROUP BY
g.goods_id
ORDER BY
NULL