Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

independent sum of two columns causes the performance down apparently.

$
0
0

     I have met this issue.

     I have a table t with 3 columns, id1,id2, num.

 

     I am doing this

 

     select a.id2 m, b.id2 n, sum(a.num), sum(b.num)

     from t a, t b

     where a.id1=b.id1

     group by a.id2, b.id2;

 

     the problem is if I don't do the two sums. the speed is quite well.

     if I add one of the sums, the speed is still reasonable, but if I add the two sums together, the speed goes down two much, about double time needed.

 

     Anyone can help on this? I think the table is a column one, the calculation of the two sums should be done in parallel, so there should not be so much different in speed.

 

     by the way, I used the 'request_flags'='ANALYZE_MODEL' in the testing. so the real sql is

 

     select a.id2 m, b.id2 n, sum(a.num), sum(b.num)

     from t a, t b

     where a.id1=b.id1

     group by a.id2, b.id2

     'request_flags'='ANALYZE_MODEL'

;


Viewing all articles
Browse latest Browse all 6412

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>