Here is a problem I would like some opinions on. I have a stored
procedure (I suspect that the problem exists for other procedures as
well, but I haven't verified it). First time it runs (each day) it
takes 8-10 minutes to run. If I rerun the procedure after a while it
runs in 2-4 minutes. The SP doesnt update any data itself, but of
course others do but that difference in data is irrelevant for the
problem. My first thought was that it had to do with data being
flushed from the bp first time the SP runs, and hence had to be read
from disk. But if I look at snapshots for statement it appears as if
this is not true (2 run, 1 run and diff):
Number of executions = 2
1 1
Number of compilations = 1
1 0
Worst preparation time (ms) = 2
2 0
Best preparation time (ms) = 2
2 0
Internal rows deleted = 0
0 0
Internal rows inserted = 0
0 0
Rows read = 2436952
1217676 1219276
Internal rows updated = 0
0 0
Rows written = 600530
299724 300806
Statement sorts = 64
32 32
Statement sort overflows = 0
0 0
Total sort time = 206
126 80
Buffer pool data logical reads = 1790269
894874 895395
Buffer pool data physical reads = 186221
95849 90372
Buffer pool temporary data logical reads = 1088320
543379 544941
Buffer pool temporary data physical reads = 843
398 445
Buffer pool index logical reads = 12090657
6036290 6054367
Buffer pool index physical reads = 409185
205583 203602
Buffer pool temporary index logical reads = 0
0 0
Buffer pool temporary index physical reads = 0
0 0
Total execution time (sec.ms) = 649.251017
484.815125 164.43589200000 002
Total user cpu time (sec.ms) = 138.900000
65.480000 73.420000000000 002
Total system cpu time (sec.ms) = 24.830000
13.320000 11.509999999999 998
Data BP hitratio = 89%
89% 89%
Index BP hitratio = 96%
96% 96%
I can see that the proc was rebinded as:
call SYSPROC.REBIND_ ROUTINE_PACKAGE ('P','<SP>','AN Y')
after runstats. Any thoughts on what might cause this behavior anyone?
Thanx
/Lennart
Comment