select /*+ index_combine(f t_fact_bjidx1 t_fact_bjidx2)
gather_plan_statistics */
d1.value as area,
d2.value as code,
sum(f.value1) as sum_value1,
max(f.value2) as max_value2,
count(*) as counts
from
t_fact f,
t_dim1 d1,
t_dim2 d2
where
f.dim1_key = d1.dim1_key and
f.dim2_key = d2.dim2_key and
d1.value like 'area1%' and
d2.value = 'code1'
group by
d1.value, d2.value
;