Direct-path inserts with reference partitioning?
There is no need to disable the foreign key. Direct-path inserts work with reference partitioning even though the documentation implies it should not.
The LOAD AS SELECT
operation below demonstrates that direct-path inserts are used:
explain plan for insert /*+ append */ into child_table select 1 from dual;select * from table(dbms_xplan.display(format => 'basic'));Plan hash value: 2781518217--------------------------------------------------------| Id | Operation | Name |--------------------------------------------------------| 0 | INSERT STATEMENT | || 1 | LOAD AS SELECT | CHILD_TABLE || 2 | OPTIMIZER STATISTICS GATHERING | || 3 | FAST DUAL | |--------------------------------------------------------
If direct-path inserts do not work with reference-partitioning it is because of one of the many other restrictions, such as triggers, a different foreign key, deferrable constraints, etc.
I would like to add one important detail. If you do direct path insert into a referenced partition table it will not only lock the 'child' table but it will also lock the 'parent' table.