翁彬 发表于 2014-4-21 18:08:45

索引使用问题

select message.* from totoro_message as message left join totoro_message_status as status on message.id = status.mid where message.to_uid = 0 and status.uid is null order by message.create_time desc
我在 totoro_message 表上建了一个多列索引(to_uid, create_time)
explain 语句后发现确实使用上了这个索引,但似乎只使用了一半,结果显示using filesort。
请问 ,要怎么把using filesort去掉?


weiryang 发表于 2014-4-22 16:16:55

感觉索引建少了还是,嘿嘿

weiryang 发表于 2014-4-22 16:17:11

http://www.ccvita.com/169.html

cifj 发表于 2014-4-28 11:13:38

left join的话索引建在totoro_message_status试试
页: [1]
查看完整版本: 索引使用问题