是否可以在下面微调我的Oracle SQL代码?所有表都位于相同的架构中。
MERGE INTO W_PURCH_COST_F TGT USING
(SELECT
/*+ PARALLEL(8) */
cost.INTEGRATION_ID,
cost.X_RECEIVED_ON_DT,
COALESCE(gaap.ROW_WID,0) X_GAAP_EXCH_RATE_WID
FROM W_Purch_Cost_F_3955 cost
JOIN W_DAY_D wday
ON TRUNC(cost.X_RECEIVED_ON_DT)=TRUNC(wday.CALENDAR_DATE)
LEFT OUTER JOIN WC_GAAP_EXCH_RATE_G gaap
ON gaap.PERIOD =wday.PER_NAME_ENT_PERIOD
) SRC ON (TGT.INTEGRATION_ID = SRC.INTEGRATION_ID AND TGT.DATASOURCE_NUM_ID = 310)
WHEN MATCHED THEN
UPDATE SET TGT.X_GAAP_EXCH_RATE_WID = SRC.X_GAAP_EXCH_RATE_WID;
TGT是目标表,SRC是源表,它们都位于暂存环境和相同的架构中。
Plan hash value: 679420733
-----------------------------------------------------------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time | TQ |IN-OUT| PQ Distrib |
-----------------------------------------------------------------------------------------------------------------------------------------------
| 0 | MERGE STATEMENT | | 18G| 256G| | 186K (5)| 00:00:15 | | | |
| 1 | MERGE | W_PURCH_COST_F | | | | | | | | |
| 2 | PX COORDINATOR | | | | | | | | | |
| 3 | PX SEND QC (RANDOM) | :TQ10002 | 18G| 10T| | 186K (5)| 00:00:15 | Q1,02 | P->S | QC (RAND) |
| 4 | VIEW | | | | | | | Q1,02 | PCWP | |
|* 5 | HASH JOIN RIGHT OUTER BUFFERED| | 18G| 10T| | 186K (5)| 00:00:15 | Q1,02 | PCWP | |
| 6 | TABLE ACCESS FULL | WC_GAAP_EXCH_RATE_G | 16261 | 269K| | 5 (0)| 00:00:01 | Q1,02 | PCWP | |
|* 7 | HASH JOIN | | 398M| 228G| 767M| 179K (1)| 00:00:15 | Q1,02 | PCWP | |
| 8 | PX RECEIVE | | 10M| 6014M| | 18997 (1)| 00:00:02 | Q1,02 | PCWP | |
| 9 | PX SEND HASH | :TQ10000 | 10M| 6014M| | 18997 (1)| 00:00:02 | Q1,00 | P->P | HASH |
| 10 | PX BLOCK ITERATOR | | 10M| 6014M| | 18997 (1)| 00:00:02 | Q1,00 | PCWC | |
|* 11 | TABLE ACCESS FULL | W_PURCH_COST_F | 10M| 6014M| | 18997 (1)| 00:00:02 | Q1,00 | PCWP | |
| 12 | PX RECEIVE | | 398M| 13G| | 28134 (2)| 00:00:03 | Q1,02 | PCWP | |
| 13 | PX SEND HASH | :TQ10001 | 398M| 13G| | 28134 (2)| 00:00:03 | Q1,01 | P->P | HASH |
|* 14 | HASH JOIN | | 398M| 13G| | 28134 (2)| 00:00:03 | Q1,01 | PCWP | |
| 15 | TABLE ACCESS FULL | W_DAY_D | 10790 | 210K| | 29 (0)| 00:00:01 | Q1,01 | PCWP | |
| 16 | PX BLOCK ITERATOR | | 383M| 6219M| | 27963 (2)| 00:00:03 | Q1,01 | PCWC | |
| 17 | TABLE ACCESS FULL | W_PURCH_COST_F_3955 | 383M| 6219M| | 27963 (2)| 00:00:03 | Q1,01 | PCWP | |
-----------------------------------------------------------------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
5 - access("GAAP"."PERIOD"(+)="WDAY"."PER_NAME_ENT_PERIOD")
7 - access("TGT"."INTEGRATION_ID"="COST"."INTEGRATION_ID")
11 - filter("TGT"."DATASOURCE_NUM_ID"=310)
14 - access(TRUNC(INTERNAL_FUNCTION("COST"."X_RECEIVED_ON_DT"))=TRUNC(INTERNAL_FUNCTION("WDAY"."CALENDAR_DATE")))
Note
-----
- dynamic statistics used: dynamic sampling (level=AUTO)
- Degree of Parallelism is 8 because of hint
- PDML is disabled in current session