New wait_time_milli
is only tracked by dba_hist_event_histogram
once it has been encountered for the first time.
Calculation currently used by TOAD:
e.wait_count - lag(e.wait_count, 1) over (order by e.event_id, e.wait_time_milli, e.snap_id) waits
This leads to wrong (and usually negative) numbers when a wait_time_milli occurs for the first time:
The calculation should something like:
e.wait_count - NVL( lag(e.wait_count, 1) over (partition by e.dbid, e.instance_number, e.event_id, e.wait_time_milli order by e.snap_id), 0 ) waits