For up-to-date results it will be necessary to run for instance this query. This will - as a side-effect - update the contents of Incremental LoadStatuses@eol
.
A faster alternative can be for max(timestamp)
to use:
declare
l_timestamp_max number;
begin
for r
in
( select PartitionCode
, max(MaxSeenTimestampCurrent) MaxSeenTimestampCurrent
from IncrementalLoadStatuses@eol
group
by PartitionCode
)
loop
select max(timestamp)
into l_timestamp_max
from SyncTransactionLines@eol
where division = r.PartitionCode
and timestamp >= r.MaxSeenTimestampCurrent
;
dbms_output.put_line('Current max for ' || r.PartitionCode || ' is ' || to_char(l_timestamp_max));
end loop;
end;
This will only retrieve the pages after the last seen timestamp and typically takes a few seconds per thousand records created since then.
For count(*)
a faster alternative is presented in: