SQL> EXEC runstats_pkg.RS_START
SQL> SELECT LREPQUESEQ, LREPSEQ, STRPARAMVAL, NTRYCOUNT, NREPSTATCD,
  2  DTSUBMITTED, DTNEXTRUN, NINTERVAL, STRUSERID FROM OM_RUN_REPORT_QUEUE
  3  WHERE DTSUBMITTED <= SYSDATE AND (NREPSTATCD=2 OR (NREPSTATCD=3 AND NINTERVAL IS NOT NULL AND DTNEXTRUN <= SYSDATE))
  4  AND MOD(LREPQUESEQ,OM_GET_CONF_INFO_FNC(34))=:B1 ORDER BY NREPSTATCD;
SQL> EXEC runstats_pkg.RS_MIDDLE
SQL> SELECT /*+ INDEX_JOIN(ORRQ XPKOM_RUN_REPORT_QUEUE,OM_RUN_REPORT_QUEUE_IDX,NU_DTSUBMITTED_ORRQ_IDX) */ LREPQUESEQ,
  2  LREPSEQ, STRPARAMVAL, NTRYCOUNT, NREPSTATCD,DTSUBMITTED, DTNEXTRUN, NINTERVAL, STRUSERID FROM OM_RUN_REPORT_QUEUE ORRQ
  3  WHERE DTSUBMITTED <= SYSDATE AND (NREPSTATCD=2 OR (NREPSTATCD=3 AND NINTERVAL IS NOT NULL AND DTNEXTRUN <= SYSDATE))
  4  AND MOD(LREPQUESEQ,OM_GET_CONF_INFO_FNC(34))=:B1 ORDER BY NREPSTATCD;
SQL> EXEC runstats_pkg.RS_STOP
Run1 ran in 3672 hsecs
Run2 ran in 1859 hsecs
run 1 ran in 197.53% of the time

Name                                  Run1        Run2        Diff
LATCH.longop free list parent            1           0          -1
LATCH.ncodef allocation latch            0           1           1
LATCH.object stats modificatio           0           1           1
LATCH.session switching                  0           1           1
LATCH.transaction branch alloc           0           1           1
STAT...active txn count during           3           4           1
STAT...calls to kcmgcs                   3           4           1
STAT...dirty buffers inspected           1           0          -1
STAT...index scans kdiixs1               0           1           1
STAT...table scans (long table           1           0          -1
STAT...shared hash latch upgra           0           1           1
STAT...rollbacks only - consis           1           0          -1
STAT...redo entries                      6           7           1
STAT...prefetched blocks aged            1           0          -1
STAT...free buffer inspected             1           0          -1
STAT...cleanout - number of kt           3           4           1
STAT...calls to kcmgas                   1           0          -1
STAT...CR blocks created                 1           0          -1
LATCH.temporary table state ob           1           0          -1
LATCH.spilled msgs queues list           1           0          -1
LATCH.archive control                    0           2           2
LATCH.archive process latch              0           2           2
STAT...global cache skip prepa           2           0          -2
STAT...data blocks consistent            2           0          -2
LATCH.job workq parent latch             2           0          -2
LATCH.event group latch                  3           0          -3
STAT...consistent changes               12          15           3
LATCH.job_queue_processes para           4           1          -3
STAT...db block gets                    12          15           3
LATCH.ktm global data                    7           3          -4
LATCH.session timer                     12           7          -5
STAT...global cache cr blocks            5           0          -5
STAT...db block changes                 16          22           6
LATCH.ges process table freeli           8           0          -8
LATCH.process group creation             8           0          -8
LATCH.dummy allocation                  14           4         -10
LATCH.commit callback allocati          21          10         -11
STAT...messages sent                    12           0         -12
LATCH.transaction allocation            18           5         -13
LATCH.channel handle pool latc          17           2         -15
LATCH.sort extent pool                  34          15         -19
LATCH.list of block allocation          62          41         -21
LATCH.user lock                         26           3         -23
LATCH.ges timeout list                  48          24         -24
LATCH.KCL bast context freelis         252         280          28
LATCH.post/wait queue                  135          83         -52
LATCH.name-service pending que         102          44         -58
LATCH.Consistent RBA                   124          65         -59
LATCH.lgwr LWN SCN                     126          66         -60
LATCH.mostly latch-free SCN            126          66         -60
STAT...global cache current bl          62           0         -62
LATCH.name-service memory obje         132          64         -68
LATCH.FOB s.o list latch                71           0         -71
LATCH.sequence cache                   314         223         -91
LATCH.child cursor hash table          160          68         -92
STAT...bytes received via SQL*         953       1,052          99
LATCH.ges deadlock list                568         454        -114
STAT...redo size                     1,804       1,936         132
LATCH.process allocation               298         155        -143
LATCH.active checkpoint queue          318         161        -157
LATCH.name-service namespace b         361         187        -174
STAT...recursive cpu usage               6         235         229
LATCH.name-service request que         466         228        -238
LATCH.message pool operations          732         412        -320
STAT...CPU used by this sessio          86         416         330
STAT...CPU used when call star          86         416         330
STAT...global cache get time           346           0        -346
LATCH.redo writing                     718         368        -350
STAT...global cache current bl         676           0        -676
LATCH.redo allocation                3,091       2,360        -731
LATCH.ges process hash list          2,058       1,276        -782
LATCH.channel operations paren       1,926       1,140        -786
LATCH.simulator lru latch            1,776         840        -936
LATCH.SQL memory manager worka       1,565         618        -947
LATCH.cache buffer handles           2,348       1,374        -974
LATCH.messages                       2,267       1,228      -1,039
LATCH.gcs opaque info freelist         568       1,710       1,142
LATCH.undo global data               2,059         809      -1,250
LATCH.session allocation             2,278         605      -1,673
STAT...Elapsed Time                  3,679       1,865      -1,814
LATCH.dml lock allocation            2,397         521      -1,876
LATCH.LGWR NS Write                  3,976       2,064      -1,912
LATCH.enqueues                       4,275       1,852      -2,423
LATCH.cache buffers lru chain        4,996       1,671      -3,325
LATCH.ges domain table               6,194       2,160      -4,034
LATCH.ges group parent               6,205       2,167      -4,038
LATCH.ges group table                6,235       2,189      -4,046
LATCH.session idle bit               7,451       2,926      -4,525
LATCH.gcs shadows freelist           2,317       7,744       5,427
LATCH.ges caches resource list      10,539       4,830      -5,709
LATCH.library cache pin alloca      13,438       7,725      -5,713
STAT...gcs messages sent             5,791           0      -5,791
LATCH.ges enqueue table freeli      12,727       5,924      -6,803
LATCH.ges resource table freel      13,389       6,527      -6,862
LATCH.enqueue hash chains           12,696       4,518      -8,178
STAT...prefetched blocks             8,469           0      -8,469
LATCH.checkpoint queue latch        17,334       8,618      -8,716
STAT...physical reads               11,499           2     -11,497
STAT...global cache gets            12,172           0     -12,172
STAT...free buffer requested        12,181           2     -12,179
LATCH.ges resource hash list        28,561      14,838     -13,723
STAT...no work - consistent re      16,120       1,900     -14,220
LATCH.multiblock read objects       26,955      12,315     -14,640
STAT...table scan blocks gotte      16,121           0     -16,121
LATCH.ges process parent latch      33,608      14,415     -19,193
LATCH.KJC message pool free li      29,115       8,157     -20,958
LATCH.ksxp tid allocation           41,036      13,392     -27,644
LATCH.simulator hash latch          51,838      17,803     -34,035
LATCH.gcs resource freelist         71,547      29,337     -42,210
LATCH.KJCT flow control latch       72,339      26,886     -45,453
LATCH.KCL name table parent la      84,405      29,069     -55,336
LATCH.shared pool                   21,231      88,625      67,394
STAT...calls to get snapshot s          20      77,677      77,657
STAT...execute count                     8      77,679      77,671
STAT...recursive calls                   5      77,676      77,671
STAT...rows fetched via callba           4      77,675      77,671
STAT...table fetch by rowid              4      77,675      77,671
STAT...index fetch by key                4      77,675      77,671
STAT...table scan rows gotten       77,673           0     -77,673
LATCH.gcs resource hash            176,039      63,878    -112,161
LATCH.library cache                 45,618     180,226     134,608
STAT...buffer is not pinned co      16,129     155,350     139,221
STAT...consistent gets              16,151     157,261     141,110
STAT...session logical reads        16,163     157,276     141,113
LATCH.library cache pin             29,466     171,448     141,982
LATCH.row cache objects             22,915     167,482     144,567
LATCH.row cache enqueue latch       22,736     167,384     144,648
STAT...consistent gets - exami          13     155,356     155,343
LATCH.KCL freelist parent latc     250,449      75,396    -175,053
LATCH.KCL gc element parent la     343,142     118,023    -225,119
LATCH.cache buffers chains       1,861,743     589,023  -1,272,720

Run1 latches total versus runs -- difference and pct
Run1        Run2        Diff       Pct
3,362,139   1,864,141  -1,497,998    180.36%
SQL>
