SQL> create table small (
2n0 number,
3n1 number,
4n2 number,
5n3 number,
6n4 number,
7n5 number,
8n6 number,
9n7 number,
10n8 number,
11n9 number
12) pctfree 0;
Table created.
SQL> begin
2for i in 1..78 loop
3insert into small values (0,0,0,0,0,0,0,0,0,0);
4end loop;
5end;
6/
PL/SQL procedure successfully completed.
SQL> set timing on
SQL> declare
2n number;
3begin
4for i in 1..1000000 loop
5select sum(n0) into n from small;
6end loop;
7end;
8/
PL/SQL procedure successfully completed.
Elapsed: 00:07:437.30
SQL> declare
2n number;
3begin
4for i in 1..1000000 loop
5select sum(n9) into n from small;
6end loop;
7end;
8/
PL/SQL procedure successfully completed.
Elapsed: 00:08:482.13
|