mysql - 这条sql可以怎么优化,求帮助
阿神
阿神 2017-04-17 15:19:32
[MySQL讨论组]

select count(*) from trade where shippingtype <> "free" and status in ("TRADE_FINISHED","WAIT_SELLER_SEND_GOODS") and tosellerreachgoods = 0 and consigntime <1470110400000 and ( endtime >=1469980800000 or endtime is null ) and created >=1469980800000 and created <=1470067200000 and user = "xxxxxxxxxxxxxxxx" ;

id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE trade range trade__user,trade_user_created,trade_user_buyernick,trade__status_created,trade_user_status trade_user_created 108 NULL 588 Using index condition; Using where
阿神
阿神

闭关修行中......

全部回复(3)
阿神

Strong

黄舟

那个 不等于 影响性能

天蓬老师

从explain上来看没什么问题

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号