Last active
May 16, 2016 23:34
-
-
Save xtender/d900ee3ef37b6c06bb9020b31d1d39dd to your computer and use it in GitHub Desktop.
Oracle generators
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set echo on timing on; | |
with | |
r1 as (select level from dual connect by level <= 100), | |
r2 as (select level from dual connect by level <= 100), | |
r3 as (select level from dual connect by level <= 1000) | |
select sum(rownum) from r1, r2, r3; | |
select sum(i) from xmltable('1 to 10000000' columns i for ordinality); | |
set echo off timing off autot off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SQL> with | |
2 r1 as (select level from dual connect by level <= 100), | |
3 r2 as (select level from dual connect by level <= 100), | |
4 r3 as (select level from dual connect by level <= 1000) | |
5 select sum(rownum) from r1, r2, r3; | |
SUM(ROWNUM) | |
----------- | |
5.0000E+13 | |
Elapsed: 00:00:03.32 | |
SQL> | |
SQL> select sum(i) from xmltable('1 to 10000000' columns i for ordinality); | |
SUM(I) | |
---------- | |
5.0000E+13 | |
Elapsed: 00:00:11.77 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment