Hi i need to optimize below sql query.
insert into exa_table (column1, column2, column3, column4)
select value1, value2, value3, value4 from
(select tb2.ID, tb2.PARCELNO, tb2.SHP_ID, tb4.CUST_ID
from exa_table2 tb2
join table3 tb3 on tb2.ID = tb3.ID
join table4 tb4 on tb3.ID = tb4.ID
where tb2.STATUS='1' and tb2.ACTIVE='1' and tb2.DATE >= '20180924' AND tb2.SDATE < '20181024' and
tb4.STATUS='1' and tb4.ACTIVE='1' and
not exists (select 1 from exa_table Q where Q.ID = tb2.ID));
i already tried optimize query by adding APPEND NOLOGGING and PARALLEL, like this
insert /*+ APPEND NOLOGGING */ into exa_table (column1, column2, column3, column4)
select value1, value2, value3, value4 from
(select /*+ PARALLEL(4) */ tb2.ID, tb2.PARCELNO, tb2.SHP_ID, tb4.CUST_ID
from exa_table2 tb2
join table3 tb3 on tb2.ID = tb3.ID
join table4 tb4 on tb3.ID = tb4.ID
where tb2.STATUS='1' and tb2.ACTIVE='1' and tb2.DATE >= '20180924' AND tb2.SDATE < '20181024' and
tb4.STATUS='1' and tb4.ACTIVE='1' and
not exists (select 1 from exa_table Q where Q.ID = tb2.ID));
It's much better now but still not enought - took 13 minutes to insert ~100k rows
Do you have any ideas how to improve query ?