title: Performant copy of data over a dblink
body: <p>We have to periodically copy data from the main database to an auxiliary database. I have the following procedure in the auxiliary db side:</p>
  <pre><code>procedure p_proc(start_date DATE, end_date DATE := sysdate) as
  begin
      insert into foo select /*+DRIVING_SITE(f) PARALLEL(8)*/  f.* 
                      from remote_foo f 
                      where f.tsp &gt;= start_date and f.tsp &lt; end_date;
      insert into foo_c1 select /*+DRIVING_SITE(f) PARALLEL(8)*/ c.* 
                         from remote_foo_c1 c join remote_foo f 
                         on c.fk = f.pk 
                         where f.tsp &gt;= start_date and f.tsp &lt; end_date;
      --13 more child tables
      commit;
  end;
  </code></pre>
  <p>On average of 7million records for the main table (foo), it takes like 20min.</p>
  <p>Are there more improvements that I could apply apart from the parallelism and the driving site hints?</p>
  <p>Explain plan for the 2nd query (foo_c1): <a href="https://pastebin.com/raw/79GWjj19" rel="nofollow noreferrer">https://pastebin.com/raw/79GWjj19</a></p>
  <p>All the fields used in the filter have indexes, on both sides.
  Oracle 19c (19.11.0.0.0).</p>