oracle数据库中使用group by 使用效率

这段代码如何改进能够使得效率更快,求大神帮助。
select d.code code,
d.name 招标类型,
sum(o.sale_cost) 消耗金额,
b.fee_code fee_code
from pha_com_output o, pha_com_baseinfo b, com_dictionary d
where d.type = 'BiddingDrugLevel'
and o.drug_code = b.drug_code
and d.code = b.special_flag
and o.out_type in ('M1', 'M2', 'Z1', 'Z2')
group by d.name, d.code, b.fee_code

看执行计划,还有就是用连接查询(走索引),还有就是用临时表(with as...语句)。

添加索引,使用连接查询应该会快点

先看执行计划,
再添加适当的索引

参考自:
MySQL如何优化GROUP BY http://www.data.5helpyou.com/article237.html