Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
Can you please make me understand what is difference between Sum(1) and Count(1). I checked with my test data set. It looks same to me. Is there any Performance difference between them?
Thanks in advance for your help...
Thanks,
Sarif
AFAIK there shouldn't be any difference in performance. Check this link:
A Myth About Count(distinct …)
HIC did a comparison between Count(), Count(DISTINCT ...), and Sum()
Hi Sarif,
---> Sum(1) : If you have Dimension like A,B,C and user expression is sum(1) means this will return value is A=3,B=3,C=3. It sums the number of dimensions. if you use sum(2) as expression it will returns A=6,B=6,C=6. which means it sums the dimensions two times.
---> Count(1): If you have Dimension like A,B,C and user expression is Count(1) means this will returns A=3,B=3,C=3. It Counts the number of dimensions.if you use Count(2) as expression it will returns A=3,B=3,C=3. which means it Counts the dimensions only one time.
There is no difference between Sum(1) and Count(1) on performance wise(tested on 10M data sets).
Dear Ram,
Which one is better wrf to Performance?
Thanks,
Sarif