only 3 columns, id1,id2 are string, num is a double. I use id1 to join.
while executing this,
select a.id2 m, b.id2 n, count(*)
from t a, t b
where a.id1=b.id1
group by a.id2, b.id2;
it takes 7s.
when executing this,
select a.id2 m, b.id2 n, count(*), sum(a.num)
from t a, t b
where a.id1=b.id1
group by a.id2, b.id2;
it takes 8s.
while executing this,
select a.id2 m, b.id2 n, count(*), sum(a.num), sum(b.num)
from t a, t b
where a.id1=b.id1
group by a.id2, b.id2;
it takes 16s.
as my understanding of HANA, the last query should take only about 9s.