parallel PDML with disabled FK

---PDML--------

GOAL

Parallel DML (PDML) must be explicitly enabled in order for DML to be considered for parallel execution.  In RDBMS versions lower than 12c, you could accomplish this only at the session level by using an ALTER SESSION statement. Assuming restrictions on parallel DML do not apply to your situation, once the session is altered, all further statements in the session will be candidates for execution of DML in parallel.

ALTER SESSION ENABLE PARALLEL DML;
<execute DML statement> 

SOLUTION

NOTE: In the images and/or the document content below, the user information and data used represents fictitious
data from the Oracle sample schema(s) or Public Documentation delivered with an Oracle database product.  
Any similarity to actual persons, living or dead, is purely coincidental and not intended in any manner.

New Hint in 12c: ENABLE_PARALLEL_DML

Starting in 12c, there is a new hint that will let you enable PDML at the statement level: ENABLE_PARALLEL_DML

/*+ enable_parallel_dml parallel(x) */  -- (x) is optional, where x is the requested degree of parallelism

Example 1: PDML is disabled

In this example, the select will run in parallel, but the load will be done serially because PDML is not explicitly enabled.  In 12c, the explain plan will include the reason that PDML was not considered.

insert /*+ parallel */ into t1 select * from t1_staging;

Execution Plan

----------------------------------------------------------
| Id | Operation                          | Name         | 
----------------------------------------------------------
| 0 | INSERT STATEMENT                    |              |
| 1 |  LOAD TABLE CONVENTIONAL            | T1           | <---- LOAD is not under a PX COORDINATOR, so PDML is disabled
| 2 |   PX COORDINATOR                    |              |
| 3 |    PX SEND QC (RANDOM)              | :TQ10000     |
| 4 |     PX BLOCK ITERATOR               |              |
| 5 |      TABLE ACCESS FULL              | <TABLE1>     |
----------------------------------------------------------------------

Note
-----
- dynamic statistics used: dynamic sampling (level=2)
- automatic DOP: Computed Degree of Parallelism is 2
- PDML is disabled in current session   <------

 

Example 2: PDML is enabled

In this example, we see both the select and load are done in parallel.

insert /*+ parallel(8) enable_parallel_dml */ into t1 select * from t1_staging;

----------------------------------------------------------
| Id | Operation                         | Name          | 
----------------------------------------------------------
| 0 | INSERT STATEMENT                   |               |
| 1 |  PX COORDINATOR                    |               |
| 2 |   PX SEND QC (RANDOM)              | :TQ10000      |
| 3 |    LOAD AS SELECT (HYBRID TSM/HWMB)| T1            | <---- LOAD is under a PX COORDINATOR, so PDML is enabled
| 4 |     OPTIMIZER STATISTICS GATHERING |               |
| 5 |      PX BLOCK ITERATOR             |               |
| 6 |       TABLE ACCESS FULL            | <TABLE1>      |
----------------------------------------------------------

Note
-----
- dynamic statistics used: dynamic sampling (level=2)
- - Degree of Parallelism is 8 because of hint

Notes:
1. The "enable_parallel_dml" hint may occur in any order within the /*+  */ delimiters.
2. The hint "disable_parallel_dml" is also new in 12c and disables PDML at the statement level. 
3. This hint is not yet included in the 12.1 documentation. 

--------------------------------------------

APPLIES TO:

Oracle Database - Enterprise Edition - Version 19.16.0.0.0 and later
Information in this document applies to any platform.

SYMPTOMS

Since 19.16.0.0.220719 applied, parallel DML is disabled with following message shown in Execution plan note.

"PDML disabled because parent referential constraints are present"

(delete statement and update statements if it modifies a column referenced in a foreign key constraint) disabled because parent

referential constraints are present but not before

Prior to 19.16.0.0.220719 PDML was working as expected.
 

CHANGES

 Patch level 19.16.0.0.220719 applied.

CAUSE

 New restriction is introduced by fix for Bug 32078078 

parallel PDML is disabled on referential integrity tables if the operation
modifies a primary or foreign key column

SOLUTION

Run the dml serially 

or

disable the FK constraint before parallel dml,  then enable when complete.

REFERENCES

NOTE:32078078.8 - Bug 32078078 - sr21.3adbs19_lkdwn - hang - query hangs with adb s lockdown

《开发者使用GPU进行并行计算的指南》是一本旨在帮助开发者了解如何利用GPU进行并行计算的指南。GPU(图形处理单元)是一种高性能并行计算设备,可在相同时间内处理多个任务。 这本指南首先介绍了并行计算的基本概念和GPU的功能。它解释了为什么使用GPU进行并行计算可以大幅提高计算速度,并且适用于许多领域,如机器学习、科学模拟和数据分析等。了解这些基本概念对于开发者理解并实施并行计算至关重要。 随后,这本指南详细介绍了使用GPU进行并行计算的各个方面。它讲解了如何选择合适的GPU硬件以及配置硬件和软件环境。同时,它还介绍了如何编写并行计算程序,包括利用GPU处理大规模数据、利用GPU编写效率高的算法和利用GPU进行并行计算任务的划分和调度等。 此外,这本指南还深入讲解了一些与GPU并行计算相关的技术和工具。例如,它介绍了CUDA(Compute Unified Device Architecture)编程模型和OpenCL(Open Computing Language)等用于编写GPU并行计算程序的工具。同时,它还提供了一些常见的GPU并行计算问题及其解决方法。 总之,《开发者使用GPU进行并行计算的指南》是一本对于开发者来说非常重要的指南,它帮助开发者理解并行计算的基本概念和GPU的工作原理,并提供了如何配置环境、编写程序以及解决问题的详细指导。对于想要利用GPU进行高性能并行计算的开发者来说,这本指南是一本必备的参考书。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值