您的位置:首页 > 编程语言 > PHP开发

yii使用表单–创建表单

2011-11-29 20:18 197 查看
desc select count(distinct(uid)),sum(item3) from user_credit_20130203 where (action='CreditBuy' or action='Credit' or action='CostCredit') and item6>=31 and item6<=60 and item1>=16 and item1<=20 and item4=0 and zoneid=0 and type='CostCredit_CW'\G

http://space.itpub.net/12457158/viewspace-753687
distinct
group by

select type,sum(credit) from credit_tmp where uid=1272800715289245 group by type

执行时间0.02s

select type,sum(credit) from credit_tmp where uid=1541051459059686 and
(type = 'AccArmyCr' or type='AccMinePrc' or type='AccUpgrade' or type='BIP' or type='BRTOPUP' or type='CostCredit_bigmaize'
or type='CostCredit_CW' or type='CostCredit_FREWARD' or type='CostCredit_gaojilabazhou' or type='CostCredit_GENERAL'
or type='CostCredit_gongxifacai' or type='CostCredit_jinchui' or type='CostCredit_LY' or type='CostCredit_MAP'
or type='CostCredit_supermaize' or type='CostCredit_yibenwanli' or type='ENL' or type='MaxEnergy' or type='RecoverArmy'
or type='RepairBld' or type='sciencelevelup' or type='yellowgunbuff') group by type

执行时间0.00s

对于or 和 in的解释,官方文档
http://dev.mysql.com/doc/internals/en/optimizer-primary-optimizations.html

主题:mysql性能优化-慢查询分析、优化索引和配置
http://www.iteye.com/topic/1129447
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: