Skip to Content
0
Former Member
May 11, 2016 at 11:24 AM

huge(?) performance gap in Counting and summing a table column values ?

23 Views

Hi experts

There is a huge performance gap(execution time) in Counting and summing a table column values

Why is that ?

######### test case

(DBA)> create table test11 (c1 numeric);

Execution time: 0.027 seconds

(DBA)> insert into test11 select 1 from big_table;

109520474 row(s) inserted

Execution time: 61.833 seconds

(DBA)> commit;

Execution time: 0.016 seconds

(DBA)> select count(c1) from test11

count(test11.c1)

--------------------

109520474

(1 rows)

Execution time: 0.007 seconds <<<<<

(DBA)> select sum(c1) from rdwadm.test11

sum(test11.c1) --------------------------------------------------------------------------------------------------------------------------------

109520474.00000000000000000000000000000000000000

(1 rows)

Execution time: 1.427 seconds <<<<<