一条mysql慢查询记录求达人高手帮助

2016-07-07 15:14 来源:www.chinab4c.com 作者:ecshop专家

大侠高手帮忙看看呃,看了mysql慢查询记录有一条这样的

# Time: 120719 10:48:25
# User@Host: dbebuy_f[dbebuy_f] @ localhost [127.0.0.1]
# Query_time: 4294967294 Lock_time: 0 Rows_sent: 0 Rows_examined: 153
use dbebuy;
SELECT g.goods_id, g.goods_name, g.goods_name_style, g.market_price, g.shop_price AS org_price, g.promote_price, IFNULL(mp.user_price, g.shop_price * '1') AS shop_price, promote_start_date, promote_end_date, g.goods_brief, g.goods_thumb, goods_img, b.brand_name FROM `dbebuy`.`ecs_goods` AS g LEFT JOIN `dbebuy`.`ecs_brand` AS b ON b.brand_id = g.brand_id LEFT JOIN `dbebuy`.`ecs_member_price` AS mp ON mp.goods_id = g.goods_id AND mp.user_rank = '0' WHERE g.is_on_sale = 1 AND g.is_alone_sale = 1 AND g.is_delete = 0 AND g.brand_id = '2' AND g.shop_price >= 600 AND g.shop_price <= 900 AND is_best = 1 AND (g.cat_id IN ('6') OR g.goods_id IN ('4507') ) ORDER BY g.sort_order, g.last_update DESC LIMIT 3;

这是什么意思呃,谢谢啦!

回答:
用mysql explain 看下这条语句怎么优化

什么是快,什么是慢,靠什么区分呢

把这个SQL的函数注释掉。看看效果。