Reputation: 15723
my table field type set: (MyISAM)
`expired` tinyint(1) value:0~1
`site` int(11) value:0~3000
`area` int(11) value:0~1050
`endtime` bigint(13) value:timestamp(like:1285779723799)
I want run this SQL:
select * from `deal`
where `expired`=1 && `site`=17 && `area`=108
order by `endtime` DESC limit 0,10
how do I create Index for this sql is the fastest?
Upvotes: 0
Views: 58
Reputation: 8295
you query included all columns... then try this:
alter table test add index idx1(site, area, expired, endtime);
Upvotes: 2