The queries with "insert into uc_temp" can be long due to statistic, this can be temp, temp1, temp2, temp3 etc..
This can be caused by the statistic on the temp* tables
Release : v12.2 / v12.3
Component : Automation Engine
This can be improved by removing the statistic of these tables (UC_TEMP, UC_TEMP1, UC_TEMP2, UC_TEMP3,...)
See here how to remove statistics or ask your DBA:
The command to remove and block statistics on Oracle look like this: