帮帮偶
select c.description,c.description mon,sum(actualConsume)/1000 total from itemtypes c,inventories b ,jobItems a
where a.partid=b.partid and a.consumetime>='2008-12-13' and a.consumetime<'2009-12-16'
and c.tid=b.itemtype group by b.itemType
查询花了5s,
itemtypes 有1000, tid,description。索引tid
inventories 有266,partid,itemtype 索引partid
jobItems 30W条记录 consumetime,partid.索引partid,consumetime 其中consumetime的记录是从2009-1-1到2009-12-14范围的