Can elapsed time from dba_hist_sqlstat be greater than snapshot interval ?
626620Jul 3 2008 — edited Jul 4 2008I use the following query to colelct info on my query
select u.username,h.module,h.snap_id,
instr(to_char(sql_text),'=') || length(sql_text) signature,
to_char(cast(begin_interval_time as date),'yyyymmdd') date,
to_char(cast(begin_interval_time as date),'hh24:mi:ss') begin,
to_char(cast(end_interval_time as date),'hh24:mi:ss') end,
round(elapsed_time_delta/1000000) elapsed_sec,
round(elapsed_time_total/1000000) elapsed_total
from sys.dba_hist_sqlstat h join sys.dba_hist_snapshot s on h.snap_id=s.snap_id
join dba_users u on h.parsing_schema_id=u.user_id
join dba_hist_sqltext v on h.sql_id=v.sql_id
where instr(to_char(sql_text),'=')=685 and to_char(cast(begin_interval_time as date),'yyyymmdd')='20080703'
order by h.snap_id desc;
The out put is as below and signature is used to identify the query (roughly)
snap_id signature date begin end elapsed_sec elapsed_total_sec
78719 685-1346 080703 11:50:54 12:00:15 4968 5289
78717 685-1346 080703 11:30:15 11:40:35 321 321
My questiion is about the elapsed seconds. in thee two snapshots. The time interval between these two snapshots are less than 30 minutes=1800 seconds, while the elapsed time for this query recorded in this 30 minutes interval is
elapsed_time_delta=4968 seconds=82 minutes.
Is my query wrong, or my understanding to dba_hist_sqlstat wrong
Thanks