One of my developers is trying to perform insert into a table by selecting from a table.
Below is the query that was run. The query takes extremely long time for execution (4hrs odd).
Number of records on the table where it is getting imported is 1.2 million.
Database – Oracle 12c on Linux with archivelog mode on.
insert /*+ parallel(24) */ into data1.frido_dev select /*+ parallel(24) */ *
from DATA_MAIN;
How can the insert of such bulk volumes be optimized? Can we use append? Will that be helpful?
I'm not good at tuning queries, would be great if someone helps me out here.
Best Answer
Unless you have a special case, an
INSERT
with 1.2 million rows should be completed in seconds or minutes at most.Yes, direct-path insert may significantly reduce execution time.
The above hint in
INSERT
has no effect without the necessary prerequisites.Enable Parallel DML Mode