Skip to content

Instantly share code, notes, and snippets.

@amcintyre99
Created December 19, 2015 19:11
Show Gist options
  • Save amcintyre99/833d49245b615bd60e45 to your computer and use it in GitHub Desktop.
Save amcintyre99/833d49245b615bd60e45 to your computer and use it in GitHub Desktop.
no where clause
db2batch -a db2inst1/db2inst1 -d dbname -q on -o r 0 -f sdmlw1.sql
* Summary Table:
Type Number Repetitions Total Time (s) Min Time (s) Max Time (s) Arithmetic Mean Geometric Mean Row(s) Fetched Row(s) Output
--------- ----------- ----------- -------------- -------------- -------------- --------------- -------------- -------------- -------------
Block 1 100 5.154963 0.048700 0.056756 0.051550 0.051518 1000000 0
* Total Entries: 1
* Total Time: 5.154963 seconds
* Minimum Time: 5.154963 seconds
* Maximum Time: 5.154963 seconds
* Arithmetic Mean Time: 5.154963 seconds
* Geometric Mean Time: 5.154963 seconds
where 0 = 1
db2batch -a db2inst1/db2inst1 -d dbname -q on -o r 0 -f sdmlw1.sql
* Summary Table:
Type Number Repetitions Total Time (s) Min Time (s) Max Time (s) Arithmetic Mean Geometric Mean Row(s) Fetched Row(s) Output
--------- ----------- ----------- -------------- -------------- -------------- --------------- -------------- -------------- -------------
Block 1 100 3.679944 0.034944 0.044444 0.036799 0.036784 0 0
* Total Entries: 1
* Total Time: 3.679944 seconds
* Minimum Time: 3.679944 seconds
* Maximum Time: 3.679944 seconds
* Arithmetic Mean Time: 3.679944 seconds
* Geometric Mean Time: 3.679944 seconds
sdmlc.sql - run before each db2batch run
drop table sdml;
create table sdml (
col integer not null
);
sdmlw1.sql
--#BGBLK 100
select null
from final table
(insert into sdml (col)
with
t1 (seq) as
(values (0)
union all
select seq + 1
from t1
where seq + 1 < 10000
)
select seq
from t1
) ft (col)
where 0 = 1
;
--#EOBLK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment