You are on page 1of 35

REM INSERTING into EXPORT_TABLE

SET DEFINE OFF;


Insert into EXPORT_TABLE
("DBMS_SQLTUNE.REPORT_TUNING_TASK('2X67WP57UD9V2_TUNING_TASK11')") values ('GENERAL
INFORMATION SECTION
-------------------------------------------------------------------------------
Tuning Task Name : 2x67wp57ud9v2_tuning_task11
Tuning Task Owner : SYSTEM
Workload Type : Single SQL Statement
Scope : COMPREHENSIVE
Time Limit(seconds): 500
Completion Status : COMPLETED
Started at : 03/03/2017 16:06:46
Completed at : 03/03/2017 16:09:09

-------------------------------------------------------------------------------
Schema Name: APPS
SQL ID : 2x67wp57ud9v2
SQL Text : SELECT
RT.TRANSACTION_ID "Transaction ID"
, RT.TRANSACTION_TYPE "Transaction type"
, RT.TRANSACTION_DATE "Transaction date"
, HOU.NAME "Operating unit"
, PLA.CATEGORY_ID "Category ID"
, MCK.CONCATENATED_SEGMENTS "Purchase category"
, PLA.ITEM_ID "Item ID"
, RSH.RECEIPT_NUM "Receipt number"
, (SELECT MSIK.CONCATENATED_SEGMENTS
FROM MTL_SYSTEM_ITEMS_KFV MSIK
WHERE MSIK.ORGANIZATION_ID =RT.ORGANIZATION_ID
AND MSIK.INVENTORY_ITEM_ID = PLA.ITEM_ID
) "Item code"
, PLA.ITEM_DESCRIPTION "Item description"
, RT.QUANTITY "Transaction quantity"
, RT.UNIT_OF_MEASURE "Transaction UOM"
, RT.PRIMARY_QUANTITY "Primary quantity"

, RT.PRIMARY_UNIT_OF_MEASURE "Primary UOM"


, RT.PO_UNIT_PRICE "PO Unit Price"
, RT.CURRENCY_CONVERSION_RATE "Currency conversion rate"
, PHA.CURRENCY_CODE "Transaction currency"
, GL.CURRENCY_CODE "Functional currency"
, PHA.PO_HEADER_ID "PO header ID"
, PHA.SEGMENT1 "PO number"
, RT.PO_REVISION_NUM "PO revision number"
, PHA.AUTHORIZATION_STATUS "Authorization status"
, RT.SHIPMENT_HEADER_ID "Shipment header ID"
, RT.SHIPMENT_LINE_ID "Shipment line ID"
, PHA.TYPE_LOOKUP_CODE "PO type"
, PHA.AGENT_ID "Buyer ID"
, PAV.AGENT_NAME "Buyer name"
, APS.SEGMENT1 "Vendor number"
, APS.VENDOR_NAME "Vendor name"
, APSS.VENDOR_SITE_CODE "Vendor site code"
, PLA.PO_LINE_ID "PO line ID"
, PLA.LINE_NUM "PO line number"
, PLT. LINE_TYPE "Line type"
, PLL.NEED_BY_DATE "Need by date"
, HLA.LOCATION_ID "Location ID"
, HLA.LOCATION_CODE "Location code"
, RT.VENDOR_ID "Vendor ID"
, RT.VENDOR_SITE_ID "Vendor site ID"

,Pla.Item_id||'-'||APS.VENDOR_NAME "item_id and Vendor Name"


, TO_CHAR(RT.TRANSACTION_DATE,'Month') "Month"
, CASE
WHEN rtrim(to_char(RT.TRANSACTION_DATE,'Month')) in
('January','February','March')
THEN
'Quarter-1'
WHEN rtrim(to_char(RT.TRANSACTION_DATE,'Month')) in
('April','May','June')
THEN
'Quarter-2'
WHEN rtrim(to_char(RT.TRANSACTION_DATE,'Month')) in
('July','August','September')
THEN
'Quarter-3'
WHEN rtrim(to_char(RT.TRANSACTION_DATE,'Month')) in
('October','November','December')
THEN
'Quarter-4'
END "Quarter"
, TO_CHAR(RT.TRANSACTION_DATE,'YYYY') "Year"

,pr.new_price "PO Price(P_UOM)"


,QT.NEW_QUANTITY "Primary Qty (P_UOM)"
,PR.NEW_PRICE* QT.NEW_QUANTITY "Spend"
, MIN(PR.NEW_PRICE) OVER (PARTITION BY PLA.ITEM_ID) "Item
Minimum Price"
, MIN(PR.NEW_PRICE) OVER (PARTITION BY
PLA.ITEM_ID||'-'||APS.VENDOR_NAME) "Vendor Minimum Price"
, DECODE(PR.NEW_PRICE,'0','0',((PR.NEW_PRICE*
QT.NEW_QUANTITY)-(QT.NEW_QUANTITY*MIN(PR.NEW_PRICE*0.75) OVER
(PARTITION BY PLA.ITEM_ID)))) "Savings at 75% of Item Min Pr"
, DECODE(PR.NEW_PRICE,'0','0',((PR.NEW_PRICE*
QT.NEW_QUANTITY)-(QT.NEW_QUANTITY*MIN(PR.NEW_PRICE*0.9) OVER
(PARTITION BY PLA.ITEM_ID)))) "Savings at 90% of Item Min Pr"
, DECODE(PR.NEW_PRICE,'0','0',((PR.NEW_PRICE*
QT.NEW_QUANTITY)-(QT.NEW_QUANTITY*MIN(PR.NEW_PRICE) OVER
(PARTITION BY PLA.ITEM_ID)))) "Savings at Item Min Price"
,CASE
WHEN PR.NEW_PRICE >(MIN(PR.NEW_PRICE*1.1) OVER (PARTITION BY
PLA.ITEM_ID))
THEN
(PR.NEW_PRICE* QT.NEW_QUANTITY)-((QT.NEW_QUANTITY*(MIN(PR.NEW_
PRICE*1.1) OVER (PARTITION BY PLA.ITEM_ID))))

WHEN PR.NEW_PRICE <= (MIN(PR.NEW_PRICE*1.1) OVER (PARTITION


BY PLA.ITEM_ID))
THEN
0
END "Savings at 110% of Item Min Pr"
,CASE
WHEN PR.NEW_PRICE >(MIN(PR.NEW_PRICE*1.25) OVER (PARTITION BY
PLA.ITEM_ID))
THEN
(PR.NEW_PRICE* QT.NEW_QUANTITY)-((QT.NEW_QUANTITY*(MIN(PR.NEW_
PRICE*1.1) OVER (PARTITION BY PLA.ITEM_ID))))

WHEN PR.NEW_PRICE <= (MIN(PR.NEW_PRICE*1.25) OVER (PARTITION


BY PLA.ITEM_ID))
THEN
0
END "Savings at 125% of Item Min Pr"

,ROUND(SUM(PR.NEW_PRICE* QT.NEW_QUANTITY) OVER (PARTITION BY


PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID),5) "Item WTD avg Price"

,CASE
WHEN PR.NEW_PRICE >(ROUND(SUM(PR.NEW_PRICE* QT.NEW_QUANTITY)
OVER (PARTITION BY PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER
(PARTITION BY PLA.ITEM_ID),5)*0.6)
THEN
(PR.NEW_PRICE* QT.NEW_QUANTITY)-((QT.NEW_QUANTITY*(ROUND(SUM(P
R.NEW_PRICE* QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID),5)*0.6)))

WHEN PR.NEW_PRICE <= (ROUND(SUM(PR.NEW_PRICE*


QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID),5)*0.6)
THEN
0
END "Savings 60% of Item WTD avg Pr"

,CASE
WHEN PR.NEW_PRICE >(ROUND(SUM(PR.NEW_PRICE* QT.NEW_QUANTITY)
OVER (PARTITION BY PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER
(PARTITION BY PLA.ITEM_ID),5)*0.7)
THEN
(PR.NEW_PRICE* QT.NEW_QUANTITY)-((QT.NEW_QUANTITY*(ROUND(SUM(P
R.NEW_PRICE* QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID),5)*0.7)))

WHEN PR.NEW_PRICE <= (ROUND(SUM(PR.NEW_PRICE*


QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID),5)*0.7)
THEN
0
END "Savings 70% of Item WTD avg Pr"

,CASE
WHEN PR.NEW_PRICE >(ROUND(SUM(PR.NEW_PRICE* QT.NEW_QUANTITY)
OVER (PARTITION BY PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER
(PARTITION BY PLA.ITEM_ID),5)*0.75)
THEN
(PR.NEW_PRICE* QT.NEW_QUANTITY)-((QT.NEW_QUANTITY*(ROUND(SUM(P
R.NEW_PRICE* QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID),5)*0.75)))
WHEN PR.NEW_PRICE <= (ROUND(SUM(PR.NEW_PRICE*
QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID),5)*0.75)
THEN
0
END "Savings 75% of Item WTD avg Pr"

,CASE
WHEN PR.NEW_PRICE >(ROUND(SUM(PR.NEW_PRICE* QT.NEW_QUANTITY)
OVER (PARTITION BY PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER
(PARTITION BY PLA.ITEM_ID),5)*0.8)
THEN
(PR.NEW_PRICE* QT.NEW_QUANTITY)-((QT.NEW_QUANTITY*(ROUND(SUM(P
R.NEW_PRICE* QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID),5)*0.8)))

WHEN PR.NEW_PRICE <= (ROUND(SUM(PR.NEW_PRICE*


QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID),5)*0.8)
THEN
0
END "Savings 80% of Item WTD avg Pr"

,CASE
WHEN PR.NEW_PRICE >(ROUND(SUM(PR.NEW_PRICE* QT.NEW_QUANTITY)
OVER (PARTITION BY PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER
(PARTITION BY PLA.ITEM_ID),5)*0.9)
THEN
(PR.NEW_PRICE* QT.NEW_QUANTITY)-((QT.NEW_QUANTITY*(ROUND(SUM(P
R.NEW_PRICE* QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID),5)*0.9)))

WHEN PR.NEW_PRICE <= (ROUND(SUM(PR.NEW_PRICE*


QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID),5)*0.9)
THEN
0
END "Savings 90% of Item WTD avg Pr"

,CASE
WHEN PR.NEW_PRICE >(ROUND(SUM(PR.NEW_PRICE* QT.NEW_QUANTITY)
OVER (PARTITION BY PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER
(PARTITION BY PLA.ITEM_ID),5))
THEN
(PR.NEW_PRICE* QT.NEW_QUANTITY)-((QT.NEW_QUANTITY*(ROUND(SUM(P
R.NEW_PRICE* QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID),5))))

WHEN PR.NEW_PRICE <= (ROUND(SUM(PR.NEW_PRICE*


QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID),5))
THEN
0
END "Savings at Item WTD avg Pr"

,CASE
WHEN PR.NEW_PRICE >(ROUND(SUM(PR.NEW_PRICE* QT.NEW_QUANTITY)
OVER (PARTITION BY PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER
(PARTITION BY PLA.ITEM_ID),5)*1.1)
THEN
(PR.NEW_PRICE* QT.NEW_QUANTITY)-((QT.NEW_QUANTITY*(ROUND(SUM(P
R.NEW_PRICE* QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID),5)*1.1)))

WHEN PR.NEW_PRICE <= (ROUND(SUM(PR.NEW_PRICE*


QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID),5)*1.1)
THEN
0
END "Savings110% of Item WTD avg Pr"

,CASE
WHEN PR.NEW_PRICE >(ROUND(SUM(PR.NEW_PRICE* QT.NEW_QUANTITY)
OVER (PARTITION BY PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER
(PARTITION BY PLA.ITEM_ID),5)*1.2)
THEN
(PR.NEW_PRICE* QT.NEW_QUANTITY)-((QT.NEW_QUANTITY*(ROUND(SUM(P
R.NEW_PRICE* QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID),5)*1.2)))

WHEN PR.NEW_PRICE <= (ROUND(SUM(PR.NEW_PRICE*


QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID),5)*1.2)
THEN
0
END "Savings120% of Item WTD avg Pr"

,CASE
WHEN PR.NEW_PRICE >(ROUND(SUM(PR.NEW_PRICE* QT.NEW_QUANTITY)
OVER (PARTITION BY PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER
(PARTITION BY PLA.ITEM_ID),5)*1.25)
THEN
(PR.NEW_PRICE* QT.NEW_QUANTITY)-((QT.NEW_QUANTITY*(ROUND(SUM(P
R.NEW_PRICE* QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID),5)*1.25)))

WHEN PR.NEW_PRICE <= (ROUND(SUM(PR.NEW_PRICE*


QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID),5)*1.25)
THEN
0
END "Savings125% of Item WTD avg Pr"
,CASE
WHEN PR.NEW_PRICE >(ROUND(SUM(PR.NEW_PRICE* QT.NEW_QUANTITY)
OVER (PARTITION BY PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER
(PARTITION BY PLA.ITEM_ID),5)*1.3)
THEN
(PR.NEW_PRICE* QT.NEW_QUANTITY)-((QT.NEW_QUANTITY*(ROUND(SUM(P
R.NEW_PRICE* QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID),5)*1.3)))

WHEN PR.NEW_PRICE <= (ROUND(SUM(PR.NEW_PRICE*


QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID),5)*1.3)
THEN
0
END "Savings130% of Item WTD avg Pr"

,CASE
WHEN PR.NEW_PRICE >(ROUND(SUM(PR.NEW_PRICE* QT.NEW_QUANTITY)
OVER (PARTITION BY PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER
(PARTITION BY PLA.ITEM_ID),5)*1.4)
THEN
(PR.NEW_PRICE* QT.NEW_QUANTITY)-((QT.NEW_QUANTITY*(ROUND(SUM(P
R.NEW_PRICE* QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID),5)*1.4)))

WHEN PR.NEW_PRICE <= (ROUND(SUM(PR.NEW_PRICE*


QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID),5)*1.4)
THEN
0
END "Savings140% of Item WTD avg Pr"

,CASE
WHEN PR.NEW_PRICE >(ROUND(SUM(PR.NEW_PRICE* QT.NEW_QUANTITY)
OVER (PARTITION BY PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER
(PARTITION BY PLA.ITEM_ID),5)*1.5)
THEN
(PR.NEW_PRICE* QT.NEW_QUANTITY)-((QT.NEW_QUANTITY*(ROUND(SUM(P
R.NEW_PRICE* QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID),5)*1.5)))

WHEN PR.NEW_PRICE <= (ROUND(SUM(PR.NEW_PRICE*


QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID)/SUM(QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID),5)*1.5)
THEN
0
END "Savings150% of Item WTD avg Pr"

,CASE
WHEN PR.NEW_PRICE >(MIN(PR.NEW_PRICE) OVER (PARTITION BY
PLA.ITEM_ID||'-'||APS.VENDOR_NAME)*0.75)
THEN
(PR.NEW_PRICE* QT.NEW_QUANTITY)-(QT.NEW_QUANTITY*(MIN(PR.NEW_P
RICE) OVER (PARTITION BY PLA.ITEM_ID||'-'||APS.VENDOR_NAME)*0.75)
)

WHEN PR.NEW_PRICE <= (MIN(PR.NEW_PRICE) OVER (PARTITION BY


PLA.ITEM_ID||'-'||APS.VENDOR_NAME)*0.75)
THEN
0
END "Savings at 75% vendor Min Pr"

,CASE
WHEN PR.NEW_PRICE >(MIN(PR.NEW_PRICE) OVER (PARTITION BY
PLA.ITEM_ID||'-'||APS.VENDOR_NAME)*0.9)
THEN
(PR.NEW_PRICE* QT.NEW_QUANTITY)-(QT.NEW_QUANTITY*(MIN(PR.NEW_P
RICE) OVER (PARTITION BY PLA.ITEM_ID||'-'||APS.VENDOR_NAME)*0.9))

WHEN PR.NEW_PRICE <= (MIN(PR.NEW_PRICE) OVER (PARTITION BY


PLA.ITEM_ID||'-'||APS.VENDOR_NAME)*0.9)
THEN
0
END "Savings at90% vendor Min Pr"

,CASE
WHEN PR.NEW_PRICE >(MIN(PR.NEW_PRICE) OVER (PARTITION BY
PLA.ITEM_ID||'-'||APS.VENDOR_NAME))
THEN
(PR.NEW_PRICE* QT.NEW_QUANTITY)-(QT.NEW_QUANTITY*(MIN(PR.NEW_P
RICE) OVER (PARTITION BY PLA.ITEM_ID||'-'||APS.VENDOR_NAME)))

WHEN PR.NEW_PRICE <= (MIN(PR.NEW_PRICE) OVER (PARTITION BY


PLA.ITEM_ID||'-'||APS.VENDOR_NAME))
THEN
0
END "Savings at vendor Min Pr"

,CASE
WHEN PR.NEW_PRICE >(MIN(PR.NEW_PRICE) OVER (PARTITION BY
PLA.ITEM_ID||'-'||APS.VENDOR_NAME)*1.1)
THEN
(PR.NEW_PRICE* QT.NEW_QUANTITY)-(QT.NEW_QUANTITY*(MIN(PR.NEW_P
RICE) OVER (PARTITION BY PLA.ITEM_ID||'-'||APS.VENDOR_NAME)*1.1))

WHEN PR.NEW_PRICE <= (MIN(PR.NEW_PRICE) OVER (PARTITION BY


PLA.ITEM_ID||'-'||APS.VENDOR_NAME)*1.1)
THEN
0
END "Savings at 110 % vendor Min Pr"

,CASE
WHEN PR.NEW_PRICE >(MIN(PR.NEW_PRICE) OVER (PARTITION BY
PLA.ITEM_ID||'-'||APS.VENDOR_NAME)*1.25)
THEN
(PR.NEW_PRICE* QT.NEW_QUANTITY)-(QT.NEW_QUANTITY*(MIN(PR.NEW_P
RICE) OVER (PARTITION BY PLA.ITEM_ID||'-'||APS.VENDOR_NAME)*1.25)
)
WHEN PR.NEW_PRICE <= (MIN(PR.NEW_PRICE) OVER (PARTITION BY
PLA.ITEM_ID||'-'||APS.VENDOR_NAME)*1.25)
THEN
0
END "Savings at 125% vendor Min Pr"

, CASE
WHEN PR.NEW_PRICE = 0
THEN
0
WHEN QT.NEW_QUANTITY = 0
THEN
0
WHEN PR.NEW_PRICE <> 0 AND QT.NEW_QUANTITY <> 0
THEN
ROUND(SUM(PR.NEW_PRICE* QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID||'-'||APS.VENDOR_NAME)/SUM(QT.NEW_QUANTITY) OVER
(PARTITION BY PLA.ITEM_ID||'-'||APS.VENDOR_NAME),5)
END "Vendor WTD Avg Price"

,CASE
WHEN PR.NEW_PRICE*QT.NEW_QUANTITY = 0
THEN
0
WHEN PR.NEW_PRICE >(ROUND(SUM(PR.NEW_PRICE* QT.NEW_QUANTITY)
OVER (PARTITION BY PLA.ITEM_ID||'-'||APS.VENDOR_NAME)/SUM(QT.NEW_
QUANTITY) OVER (PARTITION BY PLA.ITEM_ID||'-'||APS.VENDOR_NAME),5
)*0.75)
THEN
(PR.NEW_PRICE* QT.NEW_QUANTITY)-((QT.NEW_QUANTITY*(ROUND(SUM(P
R.NEW_PRICE* QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID||'-'||APS.VENDOR_NAME)/SUM(QT.NEW_QUANTITY) OVER
(PARTITION BY PLA.ITEM_ID||'-'||APS.VENDOR_NAME),5)*0.75)))

WHEN PR.NEW_PRICE <= (ROUND(SUM(PR.NEW_PRICE*


QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID||'-'||APS.VENDOR_NAME)/SUM(QT.NEW_QUANTITY) OVER
(PARTITION BY PLA.ITEM_ID||'-'||APS.VENDOR_NAME),5)*0.75)
THEN
0
END "Savings at 75% vend WTD avg Pr"
,CASE
WHEN PR.NEW_PRICE*QT.NEW_QUANTITY = 0
THEN
0
WHEN PR.NEW_PRICE >(ROUND(SUM(PR.NEW_PRICE* QT.NEW_QUANTITY)
OVER (PARTITION BY PLA.ITEM_ID||'-'||APS.VENDOR_NAME)/SUM(QT.NEW_
QUANTITY) OVER (PARTITION BY PLA.ITEM_ID||'-'||APS.VENDOR_NAME),5
)*0.9)
THEN
(PR.NEW_PRICE* QT.NEW_QUANTITY)-((QT.NEW_QUANTITY*(ROUND(SUM(P
R.NEW_PRICE* QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID||'-'||APS.VENDOR_NAME)/SUM(QT.NEW_QUANTITY) OVER
(PARTITION BY PLA.ITEM_ID||'-'||APS.VENDOR_NAME),5)*0.9)))

WHEN PR.NEW_PRICE <= (ROUND(SUM(PR.NEW_PRICE*


QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID||'-'||APS.VENDOR_NAME)/SUM(QT.NEW_QUANTITY) OVER
(PARTITION BY PLA.ITEM_ID||'-'||APS.VENDOR_NAME),5)*0.9)
THEN
0
END "Savings at 90% vend WTD avg Pr"

,CASE
WHEN PR.NEW_PRICE*QT.NEW_QUANTITY = 0
THEN
0
WHEN PR.NEW_PRICE >(ROUND(SUM(PR.NEW_PRICE* QT.NEW_QUANTITY)
OVER (PARTITION BY PLA.ITEM_ID||'-'||APS.VENDOR_NAME)/SUM(QT.NEW_
QUANTITY) OVER (PARTITION BY PLA.ITEM_ID||'-'||APS.VENDOR_NAME),5
))
THEN
(PR.NEW_PRICE* QT.NEW_QUANTITY)-((QT.NEW_QUANTITY*(ROUND(SUM(P
R.NEW_PRICE* QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID||'-'||APS.VENDOR_NAME)/SUM(QT.NEW_QUANTITY) OVER
(PARTITION BY PLA.ITEM_ID||'-'||APS.VENDOR_NAME),5))))

WHEN PR.NEW_PRICE <= (ROUND(SUM(PR.NEW_PRICE*


QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID||'-'||APS.VENDOR_NAME)/SUM(QT.NEW_QUANTITY) OVER
(PARTITION BY PLA.ITEM_ID||'-'||APS.VENDOR_NAME),5))
THEN
0
END "Savings at vendor WTD avg Pr"

,CASE
WHEN PR.NEW_PRICE*QT.NEW_QUANTITY = 0
THEN
0
WHEN PR.NEW_PRICE >(ROUND(SUM(PR.NEW_PRICE* QT.NEW_QUANTITY)
OVER (PARTITION BY PLA.ITEM_ID||'-'||APS.VENDOR_NAME)/SUM(QT.NEW_
QUANTITY) OVER (PARTITION BY PLA.ITEM_ID||'-'||APS.VENDOR_NAME),5
)*1.1)
THEN
(PR.NEW_PRICE* QT.NEW_QUANTITY)-((QT.NEW_QUANTITY*(ROUND(SUM(P
R.NEW_PRICE* QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID||'-'||APS.VENDOR_NAME)/SUM(QT.NEW_QUANTITY) OVER
(PARTITION BY PLA.ITEM_ID||'-'||APS.VENDOR_NAME),5)*1.1)))

WHEN PR.NEW_PRICE <= (ROUND(SUM(PR.NEW_PRICE*


QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID||'-'||APS.VENDOR_NAME)/SUM(QT.NEW_QUANTITY) OVER
(PARTITION BY PLA.ITEM_ID||'-'||APS.VENDOR_NAME),5)*1.1)
THEN
0
END "Savings at 110% ven WTD avg Pr"
,CASE
WHEN PR.NEW_PRICE*QT.NEW_QUANTITY = 0
THEN
0
WHEN PR.NEW_PRICE >(ROUND(SUM(PR.NEW_PRICE* QT.NEW_QUANTITY)
OVER (PARTITION BY PLA.ITEM_ID||'-'||APS.VENDOR_NAME)/SUM(QT.NEW_
QUANTITY) OVER (PARTITION BY PLA.ITEM_ID||'-'||APS.VENDOR_NAME),5
)*1.25)
THEN
(PR.NEW_PRICE* QT.NEW_QUANTITY)-((QT.NEW_QUANTITY*(ROUND(SUM(P
R.NEW_PRICE* QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID||'-'||APS.VENDOR_NAME)/SUM(QT.NEW_QUANTITY) OVER
(PARTITION BY PLA.ITEM_ID||'-'||APS.VENDOR_NAME),5)*1.25)))

WHEN PR.NEW_PRICE <= (ROUND(SUM(PR.NEW_PRICE*


QT.NEW_QUANTITY) OVER (PARTITION BY
PLA.ITEM_ID||'-'||APS.VENDOR_NAME)/SUM(QT.NEW_QUANTITY) OVER
(PARTITION BY PLA.ITEM_ID||'-'||APS.VENDOR_NAME),5)*1.25)
THEN
0
END "Savings at 125 ven WTD avg Pr"

, CASE
WHEN PR.NEW_PRICE = 0
THEN
0
WHEN QT.NEW_QUANTITY = 0
THEN
0
WHEN PR.NEW_PRICE <> 0 AND QT.NEW_QUANTITY <> 0
THEN
(SELECT MIN(SS)
FROM
( SELECT RT1.TRANSACTION_ID TRANS_ID
,PLA1.ITEM_ID
,SUM(PR.NEW_PRICE* QT.NEW_QUANTITY) OVER (PARTITION
BY PLA1.ITEM_ID||'-'||APS1.VENDOR_NAME)/SUM(QT.NEW_QUANTITY)
OVER (PARTITION BY PLA1.ITEM_ID||'-'||APS1.VENDOR_NAME) "SS"
FROM RCV_TRANSACTIONS RT1
,AP_SUPPLIERS APS1
,PO_LINES_ALL PLA1
,PO_HEADERS_ALL PHA1
, (select rt1.transaction_id,
CASE
WHEN RT1.UNIT_OF_MEASURE ='TONS'
THEN
RT1.PO_UNIT_PRICE/2000
WHEN RT1.UNIT_OF_MEASURE ='POUNDS'
THEN
RT1.PO_UNIT_PRICE*1
WHEN RT1.UNIT_OF_MEASURE ='KILOGRAMS'
THEN
RT1.PO_UNIT_PRICE/2.20462
WHEN RT1.UNIT_OF_MEASURE ='MTONS'
THEN
(RT1.PO_UNIT_PRICE/1000)*0.453592
WHEN RT1.UNIT_OF_MEASURE ='EACH'
THEN
RT1.PO_UNIT_PRICE*1
WHEN RT1.UNIT_OF_MEASURE ='Dozen'
THEN
RT1.PO_UNIT_PRICE/12
WHEN RT1.UNIT_OF_MEASURE ='BOX of 100'
THEN
RT1.PO_UNIT_PRICE/100
ELSE RT1.PO_UNIT_PRICE*1
END NEW_PRICE
FROM RCV_TRANSACTIONS RT1
) PR

,(select rt1.transaction_id,
CASE
WHEN RT1.TRANSACTION_TYPE='RECEIVE'
THEN
CASE
WHEN RT1.UNIT_OF_MEASURE ='TONS'
THEN
RT1.QUANTITY*2000
WHEN RT1.UNIT_OF_MEASURE ='POUNDS'
THEN
RT1.QUANTITY*1
WHEN RT1.UNIT_OF_MEASURE ='KILOGRAMS'
THEN
RT1.QUANTITY*2.20462
WHEN RT1.UNIT_OF_MEASURE ='MTONS'
THEN
(RT1.QUANTITY*1000)/0.453592
WHEN RT1.UNIT_OF_MEASURE ='EACH'
THEN
RT1.QUANTITY/1
WHEN RT1.UNIT_OF_MEASURE ='Dozen'
THEN
RT1.QUANTITY*12
WHEN RT1.UNIT_OF_MEASURE ='BOX of 100'
THEN
RT1.QUANTITY*100
ELSE RT1.QUANTITY/1
END
ELSE
CASE
WHEN RT1.TRANSACTION_TYPE='RETURN TO VENDOR'
THEN
CASE
WHEN RT1.UNIT_OF_MEASURE ='TONS'
THEN
(RT1.QUANTITY*2000)*-1
WHEN RT1.UNIT_OF_MEASURE ='POUNDS'
THEN
(RT1.QUANTITY*1)*-1
WHEN RT1.UNIT_OF_MEASURE ='KILOGRAMS'
THEN
(RT1.QUANTITY*2.20462)*-1
WHEN RT1.UNIT_OF_MEASURE ='MTONS'
THEN
((RT1.QUANTITY*1000)/0.453592)*-1
WHEN RT1.UNIT_OF_MEASURE ='EACH'
THEN
(RT1.QUANTITY/1)*-1
WHEN RT1.UNIT_OF_MEASURE ='Dozen'
THEN
(RT1.QUANTITY*12)*-1
WHEN RT1.UNIT_OF_MEASURE ='BOX of 100'
THEN
(RT1.QUANTITY*100)*-1
ELSE (RT1.QUANTITY/1)*-1
END
END
END "NEW_QUANTITY"
FROM RCV_TRANSACTIONS RT1
) QT

WHERE RT1.PO_LINE_ID = PLA1.PO_LINE_ID


AND RT1.PO_HEADER_ID = PHA1.PO_HEADER_ID
AND PHA1.VENDOR_ID = APS1.VENDOR_ID
AND PR.TRANSACTION_ID = RT1.TRANSACTION_ID
AND QT.TRANSACTION_ID = RT1.TRANSACTION_ID
) XX
WHERE xx.item_id=pla.item_id)
END "Min of Vendor WTD Avg Price"
,CASE
WHEN PR.NEW_PRICE*QT.NEW_QUANTITY = 0
THEN
0
WHEN PR.NEW_PRICE >YY.VEND_PRICE*0.75
THEN
(PR.NEW_PRICE* QT.NEW_QUANTITY)-((QT.NEW_QUANTITY*YY.VEND_PRIC
E)*0.75)

WHEN PR.NEW_PRICE <= YY.VEND_PRICE*0.75


THEN
0
END "Savings 75% min ven WTD avg Pr"

,CASE
WHEN PR.NEW_PRICE*QT.NEW_QUANTITY = 0
THEN
0
WHEN PR.NEW_PRICE >YY.VEND_PRICE*0.9
THEN
(PR.NEW_PRICE* QT.NEW_QUANTITY)-((QT.NEW_QUANTITY*YY.VEND_PRIC
E)*0.9)

WHEN PR.NEW_PRICE <= YY.VEND_PRICE*0.9


THEN
0
END "Savings 90% min ven WTD avg Pr"

,CASE
WHEN PR.NEW_PRICE*QT.NEW_QUANTITY = 0
THEN
0
WHEN PR.NEW_PRICE >YY.VEND_PRICE
THEN
(PR.NEW_PRICE* QT.NEW_QUANTITY)-((QT.NEW_QUANTITY*YY.VEND_PRIC
E))

WHEN PR.NEW_PRICE <= YY.VEND_PRICE


THEN
0
END "Savings at min ven WTD avg Pr"

,CASE
WHEN PR.NEW_PRICE*QT.NEW_QUANTITY = 0
THEN
0
WHEN PR.NEW_PRICE >YY.VEND_PRICE*1.1
THEN
(PR.NEW_PRICE* QT.NEW_QUANTITY)-((QT.NEW_QUANTITY*YY.VEND_PRIC
E)*1.1)

WHEN PR.NEW_PRICE <= YY.VEND_PRICE*1.1


THEN
0
END "Saving 110% min ven WTD avg Pr"

,CASE
WHEN PR.NEW_PRICE*QT.NEW_QUANTITY = 0
THEN
0
WHEN PR.NEW_PRICE >YY.VEND_PRICE*1.25
THEN
(PR.NEW_PRICE* QT.NEW_QUANTITY)-((QT.NEW_QUANTITY*YY.VEND_PRIC
E)*1.25)

WHEN PR.NEW_PRICE <= YY.VEND_PRICE*1.25


THEN
0
END "Saving 125% min ven WTD avg Pr"

FROM RCV_TRANSACTIONS RT
, PO_HEADERS_ALL PHA
, PO_AGENTS_V PAV
, AP_SUPPLIERS APS
, AP_SUPPLIER_SITES_ALL APSS
, PO_LINES_ALL PLA
, MTL_CATEGORIES_KFV MCK
, PO_LINE_TYPES PLT
, PO_LINE_LOCATIONS_ALL PLL
, RCV_SHIPMENT_HEADERS RSH
, ORG_ORGANIZATION_DEFINITIONS OOD
, HR_OPERATING_UNITS HOU
, GL_LEDGERS GL
, HR_LOCATIONS_ALL HLA
, (select rt1.transaction_id,
CASE
WHEN RT1.UNIT_OF_MEASURE ='TONS'
THEN
(RT1.PO_UNIT_PRICE/2000)*RT1.CURRENCY_CONVERSION_RATE
WHEN RT1.UNIT_OF_MEASURE ='POUNDS'
THEN
RT1.PO_UNIT_PRICE*1*RT1.CURRENCY_CONVERSION_RATE
WHEN RT1.UNIT_OF_MEASURE ='KILOGRAMS'
THEN
(RT1.PO_UNIT_PRICE/2.20462)*RT1.CURRENCY_CONVERSION_RATE
WHEN RT1.UNIT_OF_MEASURE ='MTONS'
THEN
(RT1.PO_UNIT_PRICE/1000)*0.453592*RT1.CURRENCY_CONVERSION_RA
TE
WHEN RT1.UNIT_OF_MEASURE ='EACH'
THEN
RT1.PO_UNIT_PRICE*1*RT1.CURRENCY_CONVERSION_RATE
WHEN RT1.UNIT_OF_MEASURE ='Dozen'
THEN
(RT1.PO_UNIT_PRICE/12)*RT1.CURRENCY_CONVERSION_RATE
WHEN RT1.UNIT_OF_MEASURE ='BOX of 100'
THEN
(RT1.PO_UNIT_PRICE/100)*RT1.CURRENCY_CONVERSION_RATE
ELSE RT1.PO_UNIT_PRICE*1*RT1.CURRENCY_CONVERSION_RATE
END NEW_PRICE
FROM RCV_TRANSACTIONS RT1
) PR

,(select rt1.transaction_id,
CASE
WHEN RT1.TRANSACTION_TYPE='RECEIVE'
THEN
CASE
WHEN RT1.UNIT_OF_MEASURE ='TONS'
THEN
RT1.QUANTITY*2000
WHEN RT1.UNIT_OF_MEASURE ='POUNDS'
THEN
RT1.QUANTITY*1
WHEN RT1.UNIT_OF_MEASURE ='KILOGRAMS'
THEN
RT1.QUANTITY*2.20462
WHEN RT1.UNIT_OF_MEASURE ='MTONS'
THEN
(RT1.QUANTITY*1000)/0.453592
WHEN RT1.UNIT_OF_MEASURE ='EACH'
THEN
RT1.QUANTITY/1
WHEN RT1.UNIT_OF_MEASURE ='Dozen'
THEN
RT1.QUANTITY*12
WHEN RT1.UNIT_OF_MEASURE ='BOX of 100'
THEN
RT1.QUANTITY*100
ELSE RT1.QUANTITY/1
END
ELSE
CASE
WHEN RT1.TRANSACTION_TYPE='RETURN TO VENDOR'
THEN
CASE
WHEN RT1.UNIT_OF_MEASURE ='TONS'
THEN
(RT1.QUANTITY*2000)*-1
WHEN RT1.UNIT_OF_MEASURE ='POUNDS'
THEN
(RT1.QUANTITY*1)*-1
WHEN RT1.UNIT_OF_MEASURE ='KILOGRAMS'
THEN
(RT1.QUANTITY*2.20462)*-1
WHEN RT1.UNIT_OF_MEASURE ='MTONS'
THEN
((RT1.QUANTITY*1000)/0.453592)*-1
WHEN RT1.UNIT_OF_MEASURE ='EACH'
THEN
(RT1.QUANTITY/1)*-1
WHEN RT1.UNIT_OF_MEASURE ='Dozen'
THEN
(RT1.QUANTITY*12)*-1
WHEN RT1.UNIT_OF_MEASURE ='BOX of 100'
THEN
(RT1.QUANTITY*100)*-1
ELSE (RT1.QUANTITY/1)*-1
END
END
END "NEW_QUANTITY"
FROM RCV_TRANSACTIONS RT1
) QT
,(SELECT MIN(SS) "VEND_PRICE",item_id
FROM
( SELECT RT1.TRANSACTION_ID TRANS_ID
,PLA1.ITEM_ID
,SUM(PR.NEW_PRICE* QT.NEW_QUANTITY) OVER (PARTITION
BY PLA1.ITEM_ID||'-'||APS1.VENDOR_NAME)/SUM(QT.NEW_QUANTITY)
OVER (PARTITION BY PLA1.ITEM_ID||'-'||APS1.VENDOR_NAME) "SS"
FROM RCV_TRANSACTIONS RT1
,AP_SUPPLIERS APS1
,PO_LINES_ALL PLA1
,PO_HEADERS_ALL PHA1
, (select rt1.transaction_id,
CASE
WHEN RT1.UNIT_OF_MEASURE ='TONS'
THEN
RT1.PO_UNIT_PRICE/2000
WHEN RT1.UNIT_OF_MEASURE ='POUNDS'
THEN
RT1.PO_UNIT_PRICE*1
WHEN RT1.UNIT_OF_MEASURE ='KILOGRAMS'
THEN
RT1.PO_UNIT_PRICE/2.20462
WHEN RT1.UNIT_OF_MEASURE ='MTONS'
THEN
(RT1.PO_UNIT_PRICE/1000)*0.453592
WHEN RT1.UNIT_OF_MEASURE ='EACH'
THEN
RT1.PO_UNIT_PRICE*1
WHEN RT1.UNIT_OF_MEASURE ='Dozen'
THEN
RT1.PO_UNIT_PRICE/12
WHEN RT1.UNIT_OF_MEASURE ='BOX of 100'
THEN
RT1.PO_UNIT_PRICE/100
ELSE RT1.PO_UNIT_PRICE*1
END NEW_PRICE
FROM RCV_TRANSACTIONS RT1
) PR

,(select rt1.transaction_id,
CASE
WHEN RT1.TRANSACTION_TYPE='RECEIVE'
THEN
CASE
WHEN RT1.UNIT_OF_MEASURE ='TONS'
THEN
RT1.QUANTITY*2000
WHEN RT1.UNIT_OF_MEASURE ='POUNDS'
THEN
RT1.QUANTITY*1
WHEN RT1.UNIT_OF_MEASURE ='KILOGRAMS'
THEN
RT1.QUANTITY*2.20462
WHEN RT1.UNIT_OF_MEASURE ='MTONS'
THEN
(RT1.QUANTITY*1000)/0.453592
WHEN RT1.UNIT_OF_MEASURE ='EACH'
THEN
RT1.QUANTITY/1
WHEN RT1.UNIT_OF_MEASURE ='Dozen'
THEN
RT1.QUANTITY*12
WHEN RT1.UNIT_OF_MEASURE ='BOX of 100'
THEN
RT1.QUANTITY*100
ELSE RT1.QUANTITY/1
END
ELSE
CASE
WHEN RT1.TRANSACTION_TYPE='RETURN TO VENDOR'
THEN
CASE
WHEN RT1.UNIT_OF_MEASURE ='TONS'
THEN
(RT1.QUANTITY*2000)*-1
WHEN RT1.UNIT_OF_MEASURE ='POUNDS'
THEN
(RT1.QUANTITY*1)*-1
WHEN RT1.UNIT_OF_MEASURE ='KILOGRAMS'
THEN
(RT1.QUANTITY*2.20462)*-1
WHEN RT1.UNIT_OF_MEASURE ='MTONS'
THEN
((RT1.QUANTITY*1000)/0.453592)*-1
WHEN RT1.UNIT_OF_MEASURE ='EACH'
THEN
(RT1.QUANTITY/1)*-1
WHEN RT1.UNIT_OF_MEASURE ='Dozen'
THEN
(RT1.QUANTITY*12)*-1
WHEN RT1.UNIT_OF_MEASURE ='BOX of 100'
THEN
(RT1.QUANTITY*100)*-1
ELSE (RT1.QUANTITY/1)*-1
END
END
END "NEW_QUANTITY"
FROM RCV_TRANSACTIONS RT1
) QT

WHERE RT1.PO_LINE_ID = PLA1.PO_LINE_ID


AND RT1.PO_HEADER_ID = PHA1.PO_HEADER_ID
AND PHA1.VENDOR_ID = APS1.VENDOR_ID
AND PR.TRANSACTION_ID = RT1.TRANSACTION_ID
AND QT.TRANSACTION_ID = RT1.TRANSACTION_ID
) XX
group by item_id ) YY
WHERE 1 =1
AND PLL.SHIP_TO_LOCATION_ID = HLA.LOCATION_ID
AND HOU.SET_OF_BOOKS_ID = GL.LEDGER_ID
AND OOD.OPERATING_UNIT = HOU.ORGANIZATION_ID
AND RT.ORGANIZATION_ID = OOD.ORGANIZATION_ID
AND RT.SHIPMENT_HEADER_ID = RSH.SHIPMENT_HEADER_ID
AND RT.PO_LINE_LOCATION_ID = PLL.LINE_LOCATION_ID
AND PLA.LINE_TYPE_ID = PLT.LINE_TYPE_ID
AND PLA.CATEGORY_ID = MCK.CATEGORY_ID
AND RT.PO_LINE_ID = PLA.PO_LINE_ID
AND RT.VENDOR_SITE_ID =APSS.VENDOR_SITE_ID
AND RT.VENDOR_ID = APSS.VENDOR_ID
AND PHA.VENDOR_ID = APS.VENDOR_ID
AND PHA.AGENT_ID = PAV.AGENT_ID
AND RT.PO_HEADER_ID = PHA.PO_HEADER_ID
AND RT.TRANSACTION_TYPE IN ('RECEIVE', 'RETURN TO
VENDOR')
AND PR.TRANSACTION_ID=RT.TRANSACTION_ID
AND QT.TRANSACTION_ID=RT.TRANSACTION_ID
AND YY.item_id=pla.item_id
AND TRUNC(RT.TRANSACTION_DATE) BETWEEN
TO_DATE('01-JAN-16','DD-MON-YY') AND
TO_DATE('30-DEC-16','DD-MON-YY')

ORDER BY RT.TRANSACTION_DATE

-------------------------------------------------------------------------------
FINDINGS SECTION (1 finding)
-------------------------------------------------------------------------------

1- SQL Profile Finding (see explain plans section below)


--------------------------------------------------------
A potentially better execution plan was found for this statement.

Recommendation (estimated benefit: 65.24%)


------------------------------------------
- Consider accepting the recommended SQL profile.
execute dbms_sqltune.accept_sql_profile(task_name =>
'2x67wp57ud9v2_tuning_task11', task_owner => 'SYSTEM', replace =>
TRUE);

Validation results
------------------
The SQL profile was tested by executing both its plan and the original plan
and measuring their respective execution statistics. A plan may have been
only partially executed if the other could be run to completion in less time.

Original Plan With SQL Profile % Improved


------------- ---------------- ----------
Completion Status: COMPLETE COMPLETE
Elapsed Time(ms): 390 361 7.43%
CPU Time(ms): 390 361 7.43%
User I/O Time(ms): 0 0
Buffer Gets: 34527 11979 65.3%
Disk Reads: 3 0 100%
Direct Writes: 0 0
Rows Processed: 1501 1501
Fetches: 1501 1501
Executions: 1 1

-------------------------------------------------------------------------------
EXPLAIN PLANS SECTION
-------------------------------------------------------------------------------

1- Original With Adjusted Cost


------------------------------
Plan hash value: 3711675305

-----------------------------------------------------------------------------------
-----------------------------------------------------------
| Id | Operation | Name
| Rows | Bytes | Cost (%CPU)| Time |
-----------------------------------------------------------------------------------
-----------------------------------------------------------
| 0 | SELECT STATEMENT |
| 3 | 1893 | 9580 (1)| 00:01:55 |
| 1 | TABLE ACCESS BY INDEX ROWID |
MTL_SYSTEM_ITEMS_B | 1 | 16 | 1 (0)| 00:00:01 |
|* 2 | INDEX UNIQUE SCAN |
MTL_SYSTEM_ITEMS_B_U1 | 1 | | 0 (0)| 00:00:01 |
| 3 | SORT AGGREGATE |
| 1 | 26 | | |
|* 4 | VIEW |
| 2997 | 77922 | 155 (4)| 00:00:02 |
| 5 | WINDOW SORT |
| 2997 | 239K| 155 (4)| 00:00:02 |
|* 6 | HASH JOIN |
| 2997 | 239K| 154 (4)| 00:00:02 |
| 7 | TABLE ACCESS FULL |
RCV_TRANSACTIONS | 3005 | 66110 | 38 (0)| 00:00:01 |
|* 8 | HASH JOIN |
| 2997 | 175K| 115 (4)| 00:00:02 |
| 9 | TABLE ACCESS FULL |
RCV_TRANSACTIONS | 3005 | 42070 | 38 (0)| 00:00:01 |
|* 10 | HASH JOIN |
| 2997 | 134K| 76 (4)| 00:00:01 |
| 11 | TABLE ACCESS FULL | PO_LINES_ALL
| 1554 | 12432 | 22 (0)| 00:00:01 |
|* 12 | HASH JOIN |
| 2997 | 111K| 53 (4)| 00:00:01 |
| 13 | MERGE JOIN |
| 381 | 9906 | 14 (8)| 00:00:01 |
| 14 | TABLE ACCESS BY INDEX ROWID | AP_SUPPLIERS
| 5 | 90 | 4 (0)| 00:00:01 |
| 15 | INDEX FULL SCAN |
AP_SUPPLIERS_U1 | 5 | | 1 (0)| 00:00:01 |
|* 16 | SORT JOIN |
| 382 | 3056 | 10 (10)| 00:00:01 |
| 17 | TABLE ACCESS FULL |
PO_HEADERS_ALL | 382 | 3056 | 9 (0)| 00:00:01 |
| 18 | TABLE ACCESS FULL |
RCV_TRANSACTIONS | 3005 | 36060 | 38 (0)| 00:00:01 |
| 19 | SORT ORDER BY |
| 3 | 1893 | 9580 (1)| 00:01:55 |
| 20 | WINDOW SORT |
| 3 | 1893 | 9580 (1)| 00:01:55 |
| 21 | WINDOW SORT |
| 3 | 1893 | 9580 (1)| 00:01:55 |
| 22 | NESTED LOOPS |
| | | | |
| 23 | NESTED LOOPS |
| 3 | 1893 | 9577 (1)| 00:01:55 |
| 24 | NESTED LOOPS |
| 10 | 6220 | 9567 (1)| 00:01:55 |
| 25 | NESTED LOOPS |
| 54 | 32454 | 9516 (1)| 00:01:55 |
| 26 | NESTED LOOPS |
| 277 | 154K| 8974 (1)| 00:01:48 |
| 27 | NESTED LOOPS |
| 277 | 147K| 8696 (1)| 00:01:45 |
| 28 | NESTED LOOPS |
| 277 | 146K| 8696 (1)| 00:01:45 |
| 29 | NESTED LOOPS |
| 554 | 288K| 8142 (1)| 00:01:38 |
| 30 | NESTED LOOPS |
| 489 | 241K| 7652 (1)| 00:01:32 |
| 31 | NESTED LOOPS |
| 421 | 195K| 6828 (1)| 00:01:22 |
| 32 | NESTED LOOPS |
| 421 | 188K| 6827 (1)| 00:01:22 |
| 33 | NESTED LOOPS |
| 421 | 179K| 6406 (1)| 00:01:17 |
|* 34 | HASH JOIN |
| 421 | 152K| 5984 (1)| 00:01:12 |
| 35 | NESTED LOOPS |
| | | | |
| 36 | NESTED LOOPS |
| 421 | 145K| 5828 (1)| 00:01:10 |
| 37 | NESTED LOOPS |
| 421 | 135K| 5407 (1)| 00:01:05 |
| 38 | NESTED LOOPS |
| 421 | 134K| 5406 (1)| 00:01:05 |
| 39 | NESTED LOOPS |
| 421 | 121K| 4985 (1)| 00:01:00 |
| 40 | NESTED LOOPS |
| 421 | 112K| 4564 (1)| 00:00:55 |
| 41 | NESTED LOOPS OUTER |
| 421 | 108K| 4142 (1)| 00:00:50 |
| 42 | NESTED LOOPS |
| 421 | 105K| 4142 (1)| 00:00:50 |
| 43 | NESTED LOOPS |
| 421 | 90936 | 3299 (1)| 00:00:40 |
| 44 | NESTED LOOPS |
| 421 | 83779 | 2877 (1)| 00:00:35 |
| 45 | NESTED LOOPS |
| 422 | 74694 | 2455 (1)| 00:00:30 |
| 46 | NESTED LOOPS |
| 422 | 58658 | 2033 (1)| 00:00:25 |
| 47 | NESTED LOOPS |
| 422 | 55282 | 1610 (1)| 00:00:20 |
| 48 | NESTED LOOPS |
| 422 | 53594 | 1610 (1)| 00:00:20 |
|* 49 | HASH JOIN |
| 1501 | 156K| 108 (2)| 00:00:02 |
| 50 | NESTED LOOPS |
| | | | |
| 51 | NESTED LOOPS |
| 67 | 1005 | 68 (0)| 00:00:01 |
|* 52 | INDEX FULL SCAN |
HR_ALL_ORGANIZATION_UNTS_TL_PK | 67 | 469 | 1 (0)| 00:00:01 |
|* 53 | INDEX UNIQUE SCAN |
HR_ORGANIZATION_UNITS_PK | 1 | | 0 (0)| 00:00:01 |
|* 54 | TABLE ACCESS BY INDEX ROWID|
HR_ALL_ORGANIZATION_UNITS | 1 | 8 | 1 (0)| 00:00:01 |
|* 55 | TABLE ACCESS FULL |
RCV_TRANSACTIONS | 1501 | 134K| 39 (3)| 00:00:01 |
|* 56 | TABLE ACCESS BY INDEX ROWID |
AP_SUPPLIER_SITES_ALL | 1 | 20 | 1 (0)| 00:00:01 |
|* 57 | INDEX UNIQUE SCAN |
AP_SUPPLIER_SITES_U1 | 1 | | 0 (0)| 00:00:01 |
|* 58 | INDEX UNIQUE SCAN |
MTL_PARAMETERS_U1 | 1 | 4 | 0 (0)| 00:00:01 |
| 59 | TABLE ACCESS BY INDEX ROWID |
RCV_SHIPMENT_HEADERS | 1 | 8 | 1 (0)| 00:00:01 |
|* 60 | INDEX UNIQUE SCAN |
RCV_SHIPMENT_HEADERS_U1 | 1 | | 0 (0)| 00:00:01 |
| 61 | TABLE ACCESS BY INDEX ROWID |
PO_HEADERS_ALL | 1 | 38 | 1 (0)| 00:00:01 |
|* 62 | INDEX UNIQUE SCAN | PO_HEADERS_U1
| 1 | | 0 (0)| 00:00:01 |
| 63 | TABLE ACCESS BY INDEX ROWID | AP_SUPPLIERS
| 1 | 22 | 1 (0)| 00:00:01 |
|* 64 | INDEX UNIQUE SCAN |
AP_SUPPLIERS_U1 | 1 | | 0 (0)| 00:00:01 |
| 65 | TABLE ACCESS BY INDEX ROWID | PO_AGENTS
| 1 | 17 | 1 (0)| 00:00:01 |
|* 66 | INDEX UNIQUE SCAN | PO_AGENTS_U1
| 1 | | 0 (0)| 00:00:01 |
|* 67 | TABLE ACCESS BY INDEX ROWID |
PER_ALL_PEOPLE_F | 1 | 41 | 2 (0)| 00:00:01 |
|* 68 | INDEX RANGE SCAN |
PER_PEOPLE_F_PK | 1 | | 1 (0)| 00:00:01 |
|* 69 | INDEX UNIQUE SCAN |
HR_LOCATIONS_ALL_TL_PK | 1 | 7 | 0 (0)| 00:00:01 |
| 70 | TABLE ACCESS BY INDEX ROWID |
PO_LINE_LOCATIONS_ALL | 1 | 10 | 1 (0)| 00:00:01 |
|* 71 | INDEX UNIQUE SCAN |
PO_LINE_LOCATIONS_U1 | 1 | | 0 (0)| 00:00:01 |
| 72 | TABLE ACCESS BY INDEX ROWID |
HR_LOCATIONS_ALL | 1 | 21 | 1 (0)| 00:00:01 |
|* 73 | INDEX UNIQUE SCAN |
HR_LOCATIONS_PK | 1 | | 0 (0)| 00:00:01 |
| 74 | TABLE ACCESS BY INDEX ROWID | PO_LINES_ALL
| 1 | 31 | 1 (0)| 00:00:01 |
|* 75 | INDEX UNIQUE SCAN | PO_LINES_U1
| 1 | | 0 (0)| 00:00:01 |
|* 76 | INDEX UNIQUE SCAN |
PO_LINE_TYPES_B_U1 | 1 | 3 | 0 (0)| 00:00:01 |
|* 77 | INDEX UNIQUE SCAN |
PO_LINE_TYPES_TL_U1 | 1 | | 0 (0)| 00:00:01 |
| 78 | TABLE ACCESS BY INDEX ROWID |
PO_LINE_TYPES_TL | 1 | 26 | 1 (0)| 00:00:01 |
| 79 | VIEW |
| 18 | 306 | 156 (5)| 00:00:02 |
| 80 | HASH GROUP BY |
| 18 | 306 | 156 (5)| 00:00:02 |
| 81 | VIEW |
| 2997 | 50949 | 155 (4)| 00:00:02 |
| 82 | WINDOW SORT |
| 2997 | 239K| 155 (4)| 00:00:02 |
|* 83 | FILTER |
| | | | |
|* 84 | HASH JOIN |
| 2997 | 239K| 154 (4)| 00:00:02 |
| 85 | TABLE ACCESS FULL |
RCV_TRANSACTIONS | 3005 | 66110 | 38 (0)| 00:00:01 |
|* 86 | HASH JOIN |
| 2997 | 175K| 115 (4)| 00:00:02 |
| 87 | TABLE ACCESS FULL |
RCV_TRANSACTIONS | 3005 | 42070 | 38 (0)| 00:00:01 |
|* 88 | HASH JOIN |
| 2997 | 134K| 76 (4)| 00:00:01 |
| 89 | TABLE ACCESS FULL | PO_LINES_ALL
| 1554 | 12432 | 22 (0)| 00:00:01 |
|* 90 | HASH JOIN |
| 2997 | 111K| 53 (4)| 00:00:01 |
| 91 | MERGE JOIN |
| 381 | 9906 | 14 (8)| 00:00:01 |
| 92 | TABLE ACCESS BY INDEX ROWID | AP_SUPPLIERS
| 5 | 90 | 4 (0)| 00:00:01 |
| 93 | INDEX FULL SCAN |
AP_SUPPLIERS_U1 | 5 | | 1 (0)| 00:00:01 |
|* 94 | SORT JOIN |
| 382 | 3056 | 10 (10)| 00:00:01 |
| 95 | TABLE ACCESS FULL |
PO_HEADERS_ALL | 382 | 3056 | 9 (0)| 00:00:01 |
| 96 | TABLE ACCESS FULL |
RCV_TRANSACTIONS | 3005 | 36060 | 38 (0)| 00:00:01 |
| 97 | TABLE ACCESS BY INDEX ROWID |
MTL_CATEGORIES_B | 1 | 64 | 1 (0)| 00:00:01 |
|* 98 | INDEX UNIQUE SCAN |
MTL_CATEGORIES_B_U1 | 1 | | 0 (0)| 00:00:01 |
| 99 | TABLE ACCESS BY INDEX ROWID |
RCV_TRANSACTIONS | 1 | 22 | 1 (0)| 00:00:01 |
|*100 | INDEX UNIQUE SCAN |
RCV_TRANSACTIONS_U1 | 1 | | 0 (0)| 00:00:01 |
| 101 | TABLE ACCESS BY INDEX ROWID |
RCV_TRANSACTIONS | 1 | 17 | 0 (0)| 00:00:01 |
|*102 | INDEX UNIQUE SCAN |
RCV_TRANSACTIONS_U1 | 1 | | 0 (0)| 00:00:01 |
|*103 | TABLE ACCESS BY INDEX ROWID |
HR_ORGANIZATION_INFORMATION | 1 | 30 | 2 (0)| 00:00:01 |
|*104 | INDEX RANGE SCAN |
HR_ORGANIZATION_INFORMATIO_FK2 | 1 | | 1 (0)| 00:00:01 |
| 105 | TABLE ACCESS BY INDEX ROWID |
HR_ORGANIZATION_INFORMATION | 1 | 28 | 1 (0)| 00:00:01 |
|*106 | INDEX RANGE SCAN |
HR_ORGANIZATION_INFORMATIO_FK2 | 1 | | 1 (0)| 00:00:01 |
|*107 | TABLE ACCESS BY INDEX ROWID | GL_LEDGERS
| 1 | 8 | 1 (0)| 00:00:01 |
|*108 | INDEX UNIQUE SCAN | GL_LEDGERS_U2
| 1 | | 0 (0)| 00:00:01 |
|*109 | INDEX UNIQUE SCAN |
HR_ORGANIZATION_UNITS_PK | 1 | 4 | 0 (0)| 00:00:01 |
| 110 | TABLE ACCESS BY INDEX ROWID |
HR_ALL_ORGANIZATION_UNITS_TL | 1 | 26 | 1 (0)| 00:00:01 |
|*111 | INDEX UNIQUE SCAN |
HR_ALL_ORGANIZATION_UNTS_TL_PK | 1 | | 0 (0)| 00:00:01 |
|*112 | TABLE ACCESS BY INDEX ROWID |
HR_ORGANIZATION_INFORMATION | 1 | 30 | 2 (0)| 00:00:01 |
|*113 | INDEX RANGE SCAN |
HR_ORGANIZATION_INFORMATIO_FK2 | 1 | | 1 (0)| 00:00:01 |
| 114 | TABLE ACCESS BY INDEX ROWID |
HR_ORGANIZATION_INFORMATION | 1 | 21 | 1 (0)| 00:00:01 |
|*115 | INDEX RANGE SCAN |
HR_ORGANIZATION_INFORMATIO_FK2 | 1 | | 0 (0)| 00:00:01 |
|*116 | INDEX UNIQUE SCAN | GL_LEDGERS_U2
| 1 | | 0 (0)| 00:00:01 |
| 117 | TABLE ACCESS BY INDEX ROWID | GL_LEDGERS
| 1 | 9 | 1 (0)| 00:00:01 |
-----------------------------------------------------------------------------------
-----------------------------------------------------------

Predicate Information (identified by operation id):


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

2 -
access("INVENTORY_ITEM_ID"=:B1 AND "ORGANIZATION_ID"=:B2)
4 -
filter("XX"."ITEM_ID"=:B1)
6 -
access("RT1"."TRANSACTION_ID"="RT1"."TRANSACTION_ID")
8 -
access("RT1"."TRANSACTION_ID"="RT1"."TRANSACTION_ID")
10 -
access("RT1"."PO_LINE_ID"="PLA1"."PO_LINE_ID")
12 -
access("RT1"."PO_HEADER_ID"="PHA1"."PO_HEADER_ID")
16 -
access("PHA1"."VENDOR_ID"="APS1"."VENDOR_ID")
filter("PHA1"."VENDOR_ID"="APS1"."VENDOR_ID")
34 - access("YY"."ITEM_ID"="SYS_ALIAS_3"."ITEM_ID")
49 - access("SYS_ALIAS_1"."ORGANIZATION_ID"="HAO"."ORGANIZATION_ID")
52 - access("HAOTL"."LANGUAGE"=USERENV('LANG'))

filter(DECODE("HR_SECURITY"."VIEW_ALL"(),'Y','TRUE',"HR_SECURITY"."SHOW_RECORD"('HR
_ALL_ORGANIZATION_UNITS',"HAOTL"."ORGANIZATI
ON_ID"))='TRUE' AND "HAOTL"."LANGUAGE"=USERENV('LANG'))
53 - access("HAO"."ORGANIZATION_ID"="HAOTL"."ORGANIZATION_ID")
54 -
filter("HAO"."BUSINESS_GROUP_ID"=DECODE("HR_GENERAL"."GET_XBG_PROFILE"(),'Y',"HAO".
"BUSINESS_GROUP_ID","HR_GENERAL"."GET_BUSINE
SS_GROUP_ID"()))
55 -
filter(TRUNC(INTERNAL_FUNCTION("SYS_ALIAS_1"."TRANSACTION_DATE"))>=TO_DATE('01-JAN-
16','DD-MON-YY') AND

TRUNC(INTERNAL_FUNCTION("SYS_ALIAS_1"."TRANSACTION_DATE"))<=TO_DATE('30-DEC-
16','DD-MON-YY') AND
("SYS_ALIAS_1"."TRANSACTION_TYPE"='RECEIVE' OR
"SYS_ALIAS_1"."TRANSACTION_TYPE"='RETURN TO VENDOR'))
56 - filter("SYS_ALIAS_1"."VENDOR_ID"="APSS"."VENDOR_ID")
57 - access("SYS_ALIAS_1"."VENDOR_SITE_ID"="APSS"."VENDOR_SITE_ID")
58 - access("HAO"."ORGANIZATION_ID"="MP"."ORGANIZATION_ID")
60 - access("SYS_ALIAS_1"."SHIPMENT_HEADER_ID"="RSH"."SHIPMENT_HEADER_ID")
62 - access("SYS_ALIAS_1"."PO_HEADER_ID"="PHA"."PO_HEADER_ID")
64 - access("PHA"."VENDOR_ID"="APS"."VENDOR_ID")
66 - access("PHA"."AGENT_ID"="PA"."AGENT_ID")
67 -
filter("PAPF"."BUSINESS_GROUP_ID"=DECODE("HR_GENERAL"."GET_XBG_PROFILE"(),'Y',"PAPF
"."BUSINESS_GROUP_ID","HR_GENERAL"."GET_BUSI
NESS_GROUP_ID"()))
68 - access("PA"."AGENT_ID"="PAPF"."PERSON_ID" AND
"PAPF"."EFFECTIVE_END_DATE">=TRUNC(SYSDATE@!) AND
"PAPF"."EFFECTIVE_START_DATE"<=TRUNC(SYSDATE@!))
filter("PAPF"."EFFECTIVE_END_DATE">=TRUNC(SYSDATE@!))
69 - access("PA"."LOCATION_ID"="HL"."LOCATION_ID"(+) AND
"HL"."LANGUAGE"(+)=USERENV('LANG'))
71 - access("SYS_ALIAS_1"."PO_LINE_LOCATION_ID"="PLL"."LINE_LOCATION_ID")
73 - access("PLL"."SHIP_TO_LOCATION_ID"="HLA"."LOCATION_ID")
75 - access("SYS_ALIAS_1"."PO_LINE_ID"="SYS_ALIAS_3"."PO_LINE_ID")
76 - access("SYS_ALIAS_3"."LINE_TYPE_ID"="B"."LINE_TYPE_ID")
77 - access("B"."LINE_TYPE_ID"="T"."LINE_TYPE_ID" AND
"T"."LANGUAGE"=USERENV('LANG'))
83 - filter(TO_DATE('01-JAN-16','DD-MON-YY')<=TO_DATE('30-DEC-16','DD-MON-YY'))
84 - access("RT1"."TRANSACTION_ID"="RT1"."TRANSACTION_ID")
86 - access("RT1"."TRANSACTION_ID"="RT1"."TRANSACTION_ID")
88 - access("RT1"."PO_LINE_ID"="PLA1"."PO_LINE_ID")
90 - access("RT1"."PO_HEADER_ID"="PHA1"."PO_HEADER_ID")
94 - access("PHA1"."VENDOR_ID"="APS1"."VENDOR_ID")
filter("PHA1"."VENDOR_ID"="APS1"."VENDOR_ID")
98 - access("SYS_ALIAS_3"."CATEGORY_ID"="CATEGORY_ID")
100 - access("RT1"."TRANSACTION_ID"="SYS_ALIAS_1"."TRANSACTION_ID")
102 - access("RT1"."TRANSACTION_ID"="SYS_ALIAS_1"."TRANSACTION_ID")
103 - filter("HOI1"."ORG_INFORMATION1"='INV' AND "HOI1"."ORG_INFORMATION2"='Y')
104 - access("HAO"."ORGANIZATION_ID"="HOI1"."ORGANIZATION_ID")
filter("HOI1"."ORG_INFORMATION_CONTEXT"||''='CLASS')
106 - access("HAO"."ORGANIZATION_ID"="HOI2"."ORGANIZATION_ID")
filter("HOI2"."ORG_INFORMATION_CONTEXT"||''='Accounting Information')
107 - filter(NVL("LGR"."COMPLETE_FLAG",'Y')='Y' AND "LGR"."OBJECT_TYPE_CODE"='L')
108 -
access("LGR"."LEDGER_ID"=TO_NUMBER(DECODE(RTRIM(TRANSLATE("HOI2"."ORG_INFORMATION1"
,'0123456789','
')),NULL,"HOI2"."ORG_INFORMATION1",'-99999')))
109 -
access("O"."ORGANIZATION_ID"=DECODE("HOI2"."ORG_INFORMATION_CONTEXT",'Accounting
Information',TO_NUMBER("HOI2"."ORG_INFORMATION3"),TO_NUMBER(NULL)))
111 - access("O"."ORGANIZATION_ID"="OTL"."ORGANIZATION_ID" AND
"OTL"."LANGUAGE"=USERENV('LANG'))
112 - filter("O2"."ORG_INFORMATION1"='OPERATING_UNIT' AND
"O2"."ORG_INFORMATION2"='Y')
113 - access("O"."ORGANIZATION_ID"="O2"."ORGANIZATION_ID")
filter("O2"."ORG_INFORMATION_CONTEXT"||''='CLASS')
115 - access("O"."ORGANIZATION_ID"="O3"."ORGANIZATION_ID" AND
"O3"."ORG_INFORMATION_CONTEXT"='Operating Unit Information')
116 - access("GL"."LEDGER_ID"=TO_NUMBER("O3"."ORG_INFORMATION3"))

2- Original With Adjusted Cost


------------------------------
Plan hash value: 3711675305

-----------------------------------------------------------------------------------
-----------------------------------------------------------
| Id | Operation | Name
| Rows | Bytes | Cost (%CPU)| Time |
-----------------------------------------------------------------------------------
-----------------------------------------------------------
| 0 | SELECT STATEMENT |
| 3 | 1893 | 9580 (1)| 00:01:55 |
| 1 | TABLE ACCESS BY INDEX ROWID |
MTL_SYSTEM_ITEMS_B | 1 | 16 | 1 (0)| 00:00:01 |
|* 2 | INDEX UNIQUE SCAN |
MTL_SYSTEM_ITEMS_B_U1 | 1 | | 0 (0)| 00:00:01 |
| 3 | SORT AGGREGATE |
| 1 | 26 | | |
|* 4 | VIEW |
| 2997 | 77922 | 155 (4)| 00:00:02 |
| 5 | WINDOW SORT |
| 2997 | 239K| 155 (4)| 00:00:02 |
|* 6 | HASH JOIN |
| 2997 | 239K| 154 (4)| 00:00:02 |
| 7 | TABLE ACCESS FULL |
RCV_TRANSACTIONS | 3005 | 66110 | 38 (0)| 00:00:01 |
|* 8 | HASH JOIN |
| 2997 | 175K| 115 (4)| 00:00:02 |
| 9 | TABLE ACCESS FULL |
RCV_TRANSACTIONS | 3005 | 42070 | 38 (0)| 00:00:01 |
|* 10 | HASH JOIN |
| 2997 | 134K| 76 (4)| 00:00:01 |
| 11 | TABLE ACCESS FULL | PO_LINES_ALL
| 1554 | 12432 | 22 (0)| 00:00:01 |
|* 12 | HASH JOIN |
| 2997 | 111K| 53 (4)| 00:00:01 |
| 13 | MERGE JOIN |
| 381 | 9906 | 14 (8)| 00:00:01 |
| 14 | TABLE ACCESS BY INDEX ROWID | AP_SUPPLIERS
| 5 | 90 | 4 (0)| 00:00:01 |
| 15 | INDEX FULL SCAN |
AP_SUPPLIERS_U1 | 5 | | 1 (0)| 00:00:01 |
|* 16 | SORT JOIN |
| 382 | 3056 | 10 (10)| 00:00:01 |
| 17 | TABLE ACCESS FULL |
PO_HEADERS_ALL | 382 | 3056 | 9 (0)| 00:00:01 |
| 18 | TABLE ACCESS FULL |
RCV_TRANSACTIONS | 3005 | 36060 | 38 (0)| 00:00:01 |
| 19 | SORT ORDER BY |
| 3 | 1893 | 9580 (1)| 00:01:55 |
| 20 | WINDOW SORT |
| 3 | 1893 | 9580 (1)| 00:01:55 |
| 21 | WINDOW SORT |
| 3 | 1893 | 9580 (1)| 00:01:55 |
| 22 | NESTED LOOPS |
| | | | |
| 23 | NESTED LOOPS |
| 3 | 1893 | 9577 (1)| 00:01:55 |
| 24 | NESTED LOOPS |
| 10 | 6220 | 9567 (1)| 00:01:55 |
| 25 | NESTED LOOPS |
| 54 | 32454 | 9516 (1)| 00:01:55 |
| 26 | NESTED LOOPS |
| 277 | 154K| 8974 (1)| 00:01:48 |
| 27 | NESTED LOOPS |
| 277 | 147K| 8696 (1)| 00:01:45 |
| 28 | NESTED LOOPS |
| 277 | 146K| 8696 (1)| 00:01:45 |
| 29 | NESTED LOOPS |
| 554 | 288K| 8142 (1)| 00:01:38 |
| 30 | NESTED LOOPS |
| 489 | 241K| 7652 (1)| 00:01:32 |
| 31 | NESTED LOOPS |
| 421 | 195K| 6828 (1)| 00:01:22 |
| 32 | NESTED LOOPS |
| 421 | 188K| 6827 (1)| 00:01:22 |
| 33 | NESTED LOOPS |
| 421 | 179K| 6406 (1)| 00:01:17 |
|* 34 | HASH JOIN |
| 421 | 152K| 5984 (1)| 00:01:12 |
| 35 | NESTED LOOPS |
| | | | |
| 36 | NESTED LOOPS |
| 421 | 145K| 5828 (1)| 00:01:10 |
| 37 | NESTED LOOPS |
| 421 | 135K| 5407 (1)| 00:01:05 |
| 38 | NESTED LOOPS |
| 421 | 134K| 5406 (1)| 00:01:05 |
| 39 | NESTED LOOPS |
| 421 | 121K| 4985 (1)| 00:01:00 |
| 40 | NESTED LOOPS |
| 421 | 112K| 4564 (1)| 00:00:55 |
| 41 | NESTED LOOPS OUTER |
| 421 | 108K| 4142 (1)| 00:00:50 |
| 42 | NESTED LOOPS |
| 421 | 105K| 4142 (1)| 00:00:50 |
| 43 | NESTED LOOPS |
| 421 | 90936 | 3299 (1)| 00:00:40 |
| 44 | NESTED LOOPS |
| 421 | 83779 | 2877 (1)| 00:00:35 |
| 45 | NESTED LOOPS |
| 422 | 74694 | 2455 (1)| 00:00:30 |
| 46 | NESTED LOOPS |
| 422 | 58658 | 2033 (1)| 00:00:25 |
| 47 | NESTED LOOPS |
| 422 | 55282 | 1610 (1)| 00:00:20 |
| 48 | NESTED LOOPS |
| 422 | 53594 | 1610 (1)| 00:00:20 |
|* 49 | HASH JOIN |
| 1501 | 156K| 108 (2)| 00:00:02 |
| 50 | NESTED LOOPS |
| | | | |
| 51 | NESTED LOOPS |
| 67 | 1005 | 68 (0)| 00:00:01 |
|* 52 | INDEX FULL SCAN |
HR_ALL_ORGANIZATION_UNTS_TL_PK | 67 | 469 | 1 (0)| 00:00:01 |
|* 53 | INDEX UNIQUE SCAN |
HR_ORGANIZATION_UNITS_PK | 1 | | 0 (0)| 00:00:01 |
|* 54 | TABLE ACCESS BY INDEX ROWID|
HR_ALL_ORGANIZATION_UNITS | 1 | 8 | 1 (0)| 00:00:01 |
|* 55 | TABLE ACCESS FULL |
RCV_TRANSACTIONS | 1501 | 134K| 39 (3)| 00:00:01 |
|* 56 | TABLE ACCESS BY INDEX ROWID |
AP_SUPPLIER_SITES_ALL | 1 | 20 | 1 (0)| 00:00:01 |
|* 57 | INDEX UNIQUE SCAN |
AP_SUPPLIER_SITES_U1 | 1 | | 0 (0)| 00:00:01 |
|* 58 | INDEX UNIQUE SCAN |
MTL_PARAMETERS_U1 | 1 | 4 | 0 (0)| 00:00:01 |
| 59 | TABLE ACCESS BY INDEX ROWID |
RCV_SHIPMENT_HEADERS | 1 | 8 | 1 (0)| 00:00:01 |
|* 60 | INDEX UNIQUE SCAN |
RCV_SHIPMENT_HEADERS_U1 | 1 | | 0 (0)| 00:00:01 |
| 61 | TABLE ACCESS BY INDEX ROWID |
PO_HEADERS_ALL | 1 | 38 | 1 (0)| 00:00:01 |
|* 62 | INDEX UNIQUE SCAN | PO_HEADERS_U1
| 1 | | 0 (0)| 00:00:01 |
| 63 | TABLE ACCESS BY INDEX ROWID | AP_SUPPLIERS
| 1 | 22 | 1 (0)| 00:00:01 |
|* 64 | INDEX UNIQUE SCAN |
AP_SUPPLIERS_U1 | 1 | | 0 (0)| 00:00:01 |
| 65 | TABLE ACCESS BY INDEX ROWID | PO_AGENTS
| 1 | 17 | 1 (0)| 00:00:01 |
|* 66 | INDEX UNIQUE SCAN | PO_AGENTS_U1
| 1 | | 0 (0)| 00:00:01 |
|* 67 | TABLE ACCESS BY INDEX ROWID |
PER_ALL_PEOPLE_F | 1 | 41 | 2 (0)| 00:00:01 |
|* 68 | INDEX RANGE SCAN |
PER_PEOPLE_F_PK | 1 | | 1 (0)| 00:00:01 |
|* 69 | INDEX UNIQUE SCAN |
HR_LOCATIONS_ALL_TL_PK | 1 | 7 | 0 (0)| 00:00:01 |
| 70 | TABLE ACCESS BY INDEX ROWID |
PO_LINE_LOCATIONS_ALL | 1 | 10 | 1 (0)| 00:00:01 |
|* 71 | INDEX UNIQUE SCAN |
PO_LINE_LOCATIONS_U1 | 1 | | 0 (0)| 00:00:01 |
| 72 | TABLE ACCESS BY INDEX ROWID |
HR_LOCATIONS_ALL | 1 | 21 | 1 (0)| 00:00:01 |
|* 73 | INDEX UNIQUE SCAN |
HR_LOCATIONS_PK | 1 | | 0 (0)| 00:00:01 |
| 74 | TABLE ACCESS BY INDEX ROWID | PO_LINES_ALL
| 1 | 31 | 1 (0)| 00:00:01 |
|* 75 | INDEX UNIQUE SCAN | PO_LINES_U1
| 1 | | 0 (0)| 00:00:01 |
|* 76 | INDEX UNIQUE SCAN |
PO_LINE_TYPES_B_U1 | 1 | 3 | 0 (0)| 00:00:01 |
|* 77 | INDEX UNIQUE SCAN |
PO_LINE_TYPES_TL_U1 | 1 | | 0 (0)| 00:00:01 |
| 78 | TABLE ACCESS BY INDEX ROWID |
PO_LINE_TYPES_TL | 1 | 26 | 1 (0)| 00:00:01 |
| 79 | VIEW |
| 18 | 306 | 156 (5)| 00:00:02 |
| 80 | HASH GROUP BY |
| 18 | 306 | 156 (5)| 00:00:02 |
| 81 | VIEW |
| 2997 | 50949 | 155 (4)| 00:00:02 |
| 82 | WINDOW SORT |
| 2997 | 239K| 155 (4)| 00:00:02 |
|* 83 | FILTER |
| | | | |
|* 84 | HASH JOIN |
| 2997 | 239K| 154 (4)| 00:00:02 |
| 85 | TABLE ACCESS FULL |
RCV_TRANSACTIONS | 3005 | 66110 | 38 (0)| 00:00:01 |
|* 86 | HASH JOIN |
| 2997 | 175K| 115 (4)| 00:00:02 |
| 87 | TABLE ACCESS FULL |
RCV_TRANSACTIONS | 3005 | 42070 | 38 (0)| 00:00:01 |
|* 88 | HASH JOIN |
| 2997 | 134K| 76 (4)| 00:00:01 |
| 89 | TABLE ACCESS FULL | PO_LINES_ALL
| 1554 | 12432 | 22 (0)| 00:00:01 |
|* 90 | HASH JOIN |
| 2997 | 111K| 53 (4)| 00:00:01 |
| 91 | MERGE JOIN |
| 381 | 9906 | 14 (8)| 00:00:01 |
| 92 | TABLE ACCESS BY INDEX ROWID | AP_SUPPLIERS
| 5 | 90 | 4 (0)| 00:00:01 |
| 93 | INDEX FULL SCAN |
AP_SUPPLIERS_U1 | 5 | | 1 (0)| 00:00:01 |
|* 94 | SORT JOIN |
| 382 | 3056 | 10 (10)| 00:00:01 |
| 95 | TABLE ACCESS FULL |
PO_HEADERS_ALL | 382 | 3056 | 9 (0)| 00:00:01 |
| 96 | TABLE ACCESS FULL |
RCV_TRANSACTIONS | 3005 | 36060 | 38 (0)| 00:00:01 |
| 97 | TABLE ACCESS BY INDEX ROWID |
MTL_CATEGORIES_B | 1 | 64 | 1 (0)| 00:00:01 |
|* 98 | INDEX UNIQUE SCAN |
MTL_CATEGORIES_B_U1 | 1 | | 0 (0)| 00:00:01 |
| 99 | TABLE ACCESS BY INDEX ROWID |
RCV_TRANSACTIONS | 1 | 22 | 1 (0)| 00:00:01 |
|*100 | INDEX UNIQUE SCAN |
RCV_TRANSACTIONS_U1 | 1 | | 0 (0)| 00:00:01 |
| 101 | TABLE ACCESS BY INDEX ROWID |
RCV_TRANSACTIONS | 1 | 17 | 0 (0)| 00:00:01 |
|*102 | INDEX UNIQUE SCAN |
RCV_TRANSACTIONS_U1 | 1 | | 0 (0)| 00:00:01 |
|*103 | TABLE ACCESS BY INDEX ROWID |
HR_ORGANIZATION_INFORMATION | 1 | 30 | 2 (0)| 00:00:01 |
|*104 | INDEX RANGE SCAN |
HR_ORGANIZATION_INFORMATIO_FK2 | 1 | | 1 (0)| 00:00:01 |
| 105 | TABLE ACCESS BY INDEX ROWID |
HR_ORGANIZATION_INFORMATION | 1 | 28 | 1 (0)| 00:00:01 |
|*106 | INDEX RANGE SCAN |
HR_ORGANIZATION_INFORMATIO_FK2 | 1 | | 1 (0)| 00:00:01 |
|*107 | TABLE ACCESS BY INDEX ROWID | GL_LEDGERS
| 1 | 8 | 1 (0)| 00:00:01 |
|*108 | INDEX UNIQUE SCAN | GL_LEDGERS_U2
| 1 | | 0 (0)| 00:00:01 |
|*109 | INDEX UNIQUE SCAN |
HR_ORGANIZATION_UNITS_PK | 1 | 4 | 0 (0)| 00:00:01 |
| 110 | TABLE ACCESS BY INDEX ROWID |
HR_ALL_ORGANIZATION_UNITS_TL | 1 | 26 | 1 (0)| 00:00:01 |
|*111 | INDEX UNIQUE SCAN |
HR_ALL_ORGANIZATION_UNTS_TL_PK | 1 | | 0 (0)| 00:00:01 |
|*112 | TABLE ACCESS BY INDEX ROWID |
HR_ORGANIZATION_INFORMATION | 1 | 30 | 2 (0)| 00:00:01 |
|*113 | INDEX RANGE SCAN |
HR_ORGANIZATION_INFORMATIO_FK2 | 1 | | 1 (0)| 00:00:01 |
| 114 | TABLE ACCESS BY INDEX ROWID |
HR_ORGANIZATION_INFORMATION | 1 | 21 | 1 (0)| 00:00:01 |
|*115 | INDEX RANGE SCAN |
HR_ORGANIZATION_INFORMATIO_FK2 | 1 | | 0 (0)| 00:00:01 |
|*116 | INDEX UNIQUE SCAN | GL_LEDGERS_U2
| 1 | | 0 (0)| 00:00:01 |
| 117 | TABLE ACCESS BY INDEX ROWID | GL_LEDGERS
| 1 | 9 | 1 (0)| 00:00:01 |
-----------------------------------------------------------------------------------
-----------------------------------------------------------

Predicate Information (identified by operation id):


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

2 -
access("INVENTORY_ITEM_ID"=:B1 AND "ORGANIZATION_ID"=:B2)
4 -
filter("XX"."ITEM_ID"=:B1)
6 -
access("RT1"."TRANSACTION_ID"="RT1"."TRANSACTION_ID")
8 -
access("RT1"."TRANSACTION_ID"="RT1"."TRANSACTION_ID")
10 -
access("RT1"."PO_LINE_ID"="PLA1"."PO_LINE_ID")
12 -
access("RT1"."PO_HEADER_ID"="PHA1"."PO_HEADER_ID")
16 -
access("PHA1"."VENDOR_ID"="APS1"."VENDOR_ID")
filter("PHA1"."VENDOR_ID"="APS1"."VENDOR_ID")
34 - access("YY"."ITEM_ID"="SYS_ALIAS_3"."ITEM_ID")
49 - access("SYS_ALIAS_1"."ORGANIZATION_ID"="HAO"."ORGANIZATION_ID")
52 - access("HAOTL"."LANGUAGE"=USERENV('LANG'))

filter(DECODE("HR_SECURITY"."VIEW_ALL"(),'Y','TRUE',"HR_SECURITY"."SHOW_RECORD"('HR
_ALL_ORGANIZATION_UNITS',"HAOTL"."ORGANIZATI
ON_ID"))='TRUE' AND "HAOTL"."LANGUAGE"=USERENV('LANG'))
53 - access("HAO"."ORGANIZATION_ID"="HAOTL"."ORGANIZATION_ID")
54 -
filter("HAO"."BUSINESS_GROUP_ID"=DECODE("HR_GENERAL"."GET_XBG_PROFILE"(),'Y',"HAO".
"BUSINESS_GROUP_ID","HR_GENERAL"."GET_BUSINE
SS_GROUP_ID"()))
55 -
filter(TRUNC(INTERNAL_FUNCTION("SYS_ALIAS_1"."TRANSACTION_DATE"))>=TO_DATE('01-JAN-
16','DD-MON-YY') AND

TRUNC(INTERNAL_FUNCTION("SYS_ALIAS_1"."TRANSACTION_DATE"))<=TO_DATE('30-DEC-
16','DD-MON-YY') AND
("SYS_ALIAS_1"."TRANSACTION_TYPE"='RECEIVE' OR
"SYS_ALIAS_1"."TRANSACTION_TYPE"='RETURN TO VENDOR'))
56 - filter("SYS_ALIAS_1"."VENDOR_ID"="APSS"."VENDOR_ID")
57 - access("SYS_ALIAS_1"."VENDOR_SITE_ID"="APSS"."VENDOR_SITE_ID")
58 - access("HAO"."ORGANIZATION_ID"="MP"."ORGANIZATION_ID")
60 - access("SYS_ALIAS_1"."SHIPMENT_HEADER_ID"="RSH"."SHIPMENT_HEADER_ID")
62 - access("SYS_ALIAS_1"."PO_HEADER_ID"="PHA"."PO_HEADER_ID")
64 - access("PHA"."VENDOR_ID"="APS"."VENDOR_ID")
66 - access("PHA"."AGENT_ID"="PA"."AGENT_ID")
67 -
filter("PAPF"."BUSINESS_GROUP_ID"=DECODE("HR_GENERAL"."GET_XBG_PROFILE"(),'Y',"PAPF
"."BUSINESS_GROUP_ID","HR_GENERAL"."GET_BUSI
NESS_GROUP_ID"()))
68 - access("PA"."AGENT_ID"="PAPF"."PERSON_ID" AND
"PAPF"."EFFECTIVE_END_DATE">=TRUNC(SYSDATE@!) AND
"PAPF"."EFFECTIVE_START_DATE"<=TRUNC(SYSDATE@!))
filter("PAPF"."EFFECTIVE_END_DATE">=TRUNC(SYSDATE@!))
69 - access("PA"."LOCATION_ID"="HL"."LOCATION_ID"(+) AND
"HL"."LANGUAGE"(+)=USERENV('LANG'))
71 - access("SYS_ALIAS_1"."PO_LINE_LOCATION_ID"="PLL"."LINE_LOCATION_ID")
73 - access("PLL"."SHIP_TO_LOCATION_ID"="HLA"."LOCATION_ID")
75 - access("SYS_ALIAS_1"."PO_LINE_ID"="SYS_ALIAS_3"."PO_LINE_ID")
76 - access("SYS_ALIAS_3"."LINE_TYPE_ID"="B"."LINE_TYPE_ID")
77 - access("B"."LINE_TYPE_ID"="T"."LINE_TYPE_ID" AND
"T"."LANGUAGE"=USERENV('LANG'))
83 - filter(TO_DATE('01-JAN-16','DD-MON-YY')<=TO_DATE('30-DEC-16','DD-MON-YY'))
84 - access("RT1"."TRANSACTION_ID"="RT1"."TRANSACTION_ID")
86 - access("RT1"."TRANSACTION_ID"="RT1"."TRANSACTION_ID")
88 - access("RT1"."PO_LINE_ID"="PLA1"."PO_LINE_ID")
90 - access("RT1"."PO_HEADER_ID"="PHA1"."PO_HEADER_ID")
94 - access("PHA1"."VENDOR_ID"="APS1"."VENDOR_ID")
filter("PHA1"."VENDOR_ID"="APS1"."VENDOR_ID")
98 - access("SYS_ALIAS_3"."CATEGORY_ID"="CATEGORY_ID")
100 - access("RT1"."TRANSACTION_ID"="SYS_ALIAS_1"."TRANSACTION_ID")
102 - access("RT1"."TRANSACTION_ID"="SYS_ALIAS_1"."TRANSACTION_ID")
103 - filter("HOI1"."ORG_INFORMATION1"='INV' AND "HOI1"."ORG_INFORMATION2"='Y')
104 - access("HAO"."ORGANIZATION_ID"="HOI1"."ORGANIZATION_ID")
filter("HOI1"."ORG_INFORMATION_CONTEXT"||''='CLASS')
106 - access("HAO"."ORGANIZATION_ID"="HOI2"."ORGANIZATION_ID")
filter("HOI2"."ORG_INFORMATION_CONTEXT"||''='Accounting Information')
107 - filter(NVL("LGR"."COMPLETE_FLAG",'Y')='Y' AND "LGR"."OBJECT_TYPE_CODE"='L')
108 -
access("LGR"."LEDGER_ID"=TO_NUMBER(DECODE(RTRIM(TRANSLATE("HOI2"."ORG_INFORMATION1"
,'0123456789','
')),NULL,"HOI2"."ORG_INFORMATION1",'-99999')))
109 -
access("O"."ORGANIZATION_ID"=DECODE("HOI2"."ORG_INFORMATION_CONTEXT",'Accounting
Information',TO_NUMBER("HOI2"."ORG_INFORMATION3"),TO_NUMBER(NULL)))
111 - access("O"."ORGANIZATION_ID"="OTL"."ORGANIZATION_ID" AND
"OTL"."LANGUAGE"=USERENV('LANG'))
112 - filter("O2"."ORG_INFORMATION1"='OPERATING_UNIT' AND
"O2"."ORG_INFORMATION2"='Y')
113 - access("O"."ORGANIZATION_ID"="O2"."ORGANIZATION_ID")
filter("O2"."ORG_INFORMATION_CONTEXT"||''='CLASS')
115 - access("O"."ORGANIZATION_ID"="O3"."ORGANIZATION_ID" AND
"O3"."ORG_INFORMATION_CONTEXT"='Operating Unit Information')
116 - access("GL"."LEDGER_ID"=TO_NUMBER("O3"."ORG_INFORMATION3"))

3- Using SQL Profile


--------------------
Plan hash value: 3621058837

-----------------------------------------------------------------------------------
---------------------------------------------------------
| Id | Operation | Name
| Rows | Bytes | Cost (%CPU)| Time |
-----------------------------------------------------------------------------------
---------------------------------------------------------
| 0 | SELECT STATEMENT |
| 10 | 6310 | 389 (8)| 00:00:05 |
| 1 | TABLE ACCESS BY INDEX ROWID |
MTL_SYSTEM_ITEMS_B | 1 | 16 | 1 (0)| 00:00:01 |
|* 2 | INDEX UNIQUE SCAN |
MTL_SYSTEM_ITEMS_B_U1 | 1 | | 0 (0)| 00:00:01 |
| 3 | SORT AGGREGATE |
| 1 | 26 | | |
|* 4 | VIEW |
| 2997 | 77922 | 151 (4)| 00:00:02 |
| 5 | WINDOW SORT |
| 2997 | 239K| 151 (4)| 00:00:02 |
|* 6 | HASH JOIN |
| 2997 | 239K| 149 (3)| 00:00:02 |
| 7 | TABLE ACCESS FULL |
RCV_TRANSACTIONS | 3005 | 66110 | 38 (0)| 00:00:01 |
|* 8 | HASH JOIN |
| 2997 | 175K| 111 (4)| 00:00:02 |
| 9 | TABLE ACCESS FULL |
RCV_TRANSACTIONS | 3005 | 42070 | 38 (0)| 00:00:01 |
|* 10 | HASH JOIN |
| 2997 | 134K| 72 (5)| 00:00:01 |
| 11 | TABLE ACCESS FULL | PO_LINES_ALL
| 1554 | 12432 | 22 (0)| 00:00:01 |
|* 12 | HASH JOIN |
| 2997 | 111K| 49 (5)| 00:00:01 |
| 13 | MERGE JOIN |
| 381 | 9906 | 11 (19)| 00:00:01 |
| 14 | TABLE ACCESS BY INDEX ROWID | AP_SUPPLIERS
| 5 | 90 | 4 (0)| 00:00:01 |
| 15 | INDEX FULL SCAN | AP_SUPPLIERS_U1
| 5 | | 1 (0)| 00:00:01 |
|* 16 | SORT JOIN |
| 382 | 3056 | 7 (29)| 00:00:01 |
| 17 | VIEW |
index$_join$_006 | 382 | 3056 | 6 (17)| 00:00:01 |
|* 18 | HASH JOIN |
| | | | |
| 19 | INDEX FAST FULL SCAN | PO_HEADERS_N1
| 382 | 3056 | 4 (0)| 00:00:01 |
| 20 | INDEX FAST FULL SCAN | PO_HEADERS_U1
| 382 | 3056 | 1 (0)| 00:00:01 |
| 21 | TABLE ACCESS FULL |
RCV_TRANSACTIONS | 3005 | 36060 | 38 (0)| 00:00:01 |
| 22 | SORT ORDER BY |
| 10 | 6310 | 389 (8)| 00:00:05 |
| 23 | WINDOW SORT |
| 10 | 6310 | 389 (8)| 00:00:05 |
| 24 | WINDOW SORT |
| 10 | 6310 | 389 (8)| 00:00:05 |
| 25 | NESTED LOOPS |
| 10 | 6310 | 386 (7)| 00:00:05 |
|* 26 | HASH JOIN |
| 10 | 6090 | 376 (7)| 00:00:05 |
| 27 | TABLE ACCESS FULL | GL_LEDGERS
| 10 | 90 | 5 (0)| 00:00:01 |
|* 28 | HASH JOIN |
| 34 | 20400 | 371 (8)| 00:00:05 |
| 29 | VIEW |
index$_join$_040 | 67 | 1742 | 3 (34)| 00:00:01 |
|* 30 | HASH JOIN |
| | | | |
|* 31 | INDEX RANGE SCAN |
HR_ALL_ORGANIZATION_UNTS_TL_N2 | 67 | 1742 | 2 (50)| 00:00:01 |
|* 32 | INDEX FAST FULL SCAN |
HR_ALL_ORGANIZATION_UNTS_TL_PK | 67 | 1742 | 1 (0)| 00:00:01 |
|* 33 | HASH JOIN |
| 34 | 19516 | 367 (7)| 00:00:05 |
|* 34 | TABLE ACCESS FULL |
HR_ORGANIZATION_INFORMATION | 13 | 390 | 6 (0)| 00:00:01 |
|* 35 | HASH JOIN |
| 177 | 96288 | 361 (7)| 00:00:05 |
| 36 | TABLE ACCESS BY INDEX ROWID |
HR_ORGANIZATION_INFORMATION | 12 | 252 | 5 (0)| 00:00:01 |
|* 37 | INDEX RANGE SCAN |
HR_ORGANIZATION_INFORMATIO_FK1 | 12 | | 1 (0)| 00:00:01 |
| 38 | NESTED LOOPS |
| 988 | 504K| 355 (7)| 00:00:05 |
|* 39 | HASH JOIN |
| 988 | 500K| 354 (7)| 00:00:05 |
|* 40 | TABLE ACCESS FULL | GL_LEDGERS
| 5 | 40 | 5 (0)| 00:00:01 |
|* 41 | HASH JOIN |
| 1976 | 986K| 349 (7)| 00:00:05 |
| 42 | TABLE ACCESS FULL |
RCV_TRANSACTIONS | 3005 | 51085 | 38 (0)| 00:00:01 |
|* 43 | HASH JOIN |
| 1976 | 953K| 310 (7)| 00:00:04 |
| 44 | TABLE ACCESS FULL |
HR_LOCATIONS_ALL | 51 | 1071 | 5 (0)| 00:00:01 |
|* 45 | HASH JOIN |
| 1976 | 912K| 305 (7)| 00:00:04 |
| 46 | TABLE ACCESS FULL |
PO_LINE_LOCATIONS_ALL | 1554 | 15540 | 22 (0)| 00:00:01 |
|* 47 | HASH JOIN |
| 1976 | 893K| 282 (8)| 00:00:04 |
| 48 | TABLE ACCESS FULL |
MTL_CATEGORIES_B | 217 | 13888 | 6 (0)| 00:00:01 |
|* 49 | HASH JOIN |
| 1976 | 769K| 275 (7)| 00:00:04 |
| 50 | VIEW |
| 18 | 306 | 152 (5)| 00:00:02 |
| 51 | SORT GROUP BY |
| 18 | 306 | 152 (5)| 00:00:02 |
| 52 | VIEW |
| 2997 | 50949 | 151 (4)| 00:00:02 |
| 53 | WINDOW SORT |
| 2997 | 239K| 151 (4)| 00:00:02 |
|* 54 | FILTER |
| | | | |
|* 55 | HASH JOIN |
| 2997 | 239K| 149 (3)| 00:00:02 |
| 56 | TABLE ACCESS FULL |
RCV_TRANSACTIONS | 3005 | 66110 | 38 (0)| 00:00:01 |
|* 57 | HASH JOIN |
| 2997 | 175K| 111 (4)| 00:00:02 |
| 58 | TABLE ACCESS FULL |
RCV_TRANSACTIONS | 3005 | 42070 | 38 (0)| 00:00:01 |
|* 59 | HASH JOIN |
| 2997 | 134K| 72 (5)| 00:00:01 |
| 60 | TABLE ACCESS FULL | PO_LINES_ALL
| 1554 | 12432 | 22 (0)| 00:00:01 |
|* 61 | HASH JOIN |
| 2997 | 111K| 49 (5)| 00:00:01 |
| 62 | MERGE JOIN |
| 381 | 9906 | 11 (19)| 00:00:01 |
| 63 | TABLE ACCESS BY INDEX ROWID | AP_SUPPLIERS
| 5 | 90 | 4 (0)| 00:00:01 |
| 64 | INDEX FULL SCAN | AP_SUPPLIERS_U1
| 5 | | 1 (0)| 00:00:01 |
|* 65 | SORT JOIN |
| 382 | 3056 | 7 (29)| 00:00:01 |
| 66 | VIEW |
index$_join$_034 | 382 | 3056 | 6 (17)| 00:00:01 |
|* 67 | HASH JOIN |
| | | | |
| 68 | INDEX FAST FULL SCAN | PO_HEADERS_N1
| 382 | 3056 | 4 (0)| 00:00:01 |
| 69 | INDEX FAST FULL SCAN | PO_HEADERS_U1
| 382 | 3056 | 1 (0)| 00:00:01 |
| 70 | TABLE ACCESS FULL |
RCV_TRANSACTIONS | 3005 | 36060 | 38 (0)| 00:00:01 |
|* 71 | HASH JOIN |
| 1976 | 737K| 123 (10)| 00:00:02 |
| 72 | VIEW |
index$_join$_050 | 6 | 156 | 3 (0)| 00:00:01 |
|* 73 | HASH JOIN |
| | | | |
|* 74 | INDEX FAST FULL SCAN |
PO_LINE_TYPES_TL_U1 | 6 | 156 | 1 (0)| 00:00:01 |
|* 75 | INDEX FAST FULL SCAN |
PO_LINE_TYPES_TL_U2 | 6 | 156 | 1 (0)| 00:00:01 |
| 76 | NESTED LOOPS |
| 1976 | 686K| 119 (9)| 00:00:02 |
|* 77 | HASH JOIN |
| 1976 | 681K| 118 (8)| 00:00:02 |
| 78 | TABLE ACCESS FULL | PO_LINES_ALL
| 1554 | 48174 | 22 (0)| 00:00:01 |
|* 79 | HASH JOIN |
| 1976 | 621K| 95 (9)| 00:00:02 |
| 80 | TABLE ACCESS FULL |
RCV_SHIPMENT_HEADERS | 379 | 3032 | 5 (0)| 00:00:01 |
|* 81 | HASH JOIN |
| 1976 | 605K| 90 (9)| 00:00:02 |
|* 82 | INDEX FULL SCAN |
HR_ALL_ORGANIZATION_UNTS_TL_PK | 67 | 469 | 1 (0)| 00:00:01 |
|* 83 | HASH JOIN |
| 1976 | 592K| 88 (8)| 00:00:02 |
|* 84 | TABLE ACCESS FULL |
HR_ORGANIZATION_INFORMATION | 36 | 1080 | 6 (0)| 00:00:01 |
|* 85 | HASH JOIN |
| 1701 | 460K| 81 (8)| 00:00:01 |
|* 86 | TABLE ACCESS FULL |
HR_ORGANIZATION_INFORMATION | 34 | 952 | 6 (0)| 00:00:01 |
| 87 | NESTED LOOPS |
| 1501 | 364K| 75 (8)| 00:00:01 |
|* 88 | HASH JOIN |
| 1501 | 359K| 74 (7)| 00:00:01 |
|* 89 | VIEW |
index$_join$_048 | 67 | 536 | 3 (0)| 00:00:01 |
|* 90 | HASH JOIN |
| | | | |
| 91 | INDEX FAST FULL SCAN |
HR_ORGANIZATION_UNITS_FK1 | 67 | 536 | 1 (0)| 00:00:01 |
| 92 | INDEX FAST FULL SCAN |
HR_ORGANIZATION_UNITS_PK | 67 | 536 | 1 (0)| 00:00:01 |
|* 93 | HASH JOIN |
| 1501 | 347K| 70 (6)| 00:00:01 |
| 94 | TABLE ACCESS FULL |
AP_SUPPLIER_SITES_ALL | 9 | 180 | 5 (0)| 00:00:01 |
|* 95 | HASH JOIN |
| 1497 | 317K| 64 (5)| 00:00:01 |
| 96 | NESTED LOOPS OUTER |
| 381 | 47625 | 25 (8)| 00:00:01 |
|* 97 | HASH JOIN |
| 381 | 44958 | 25 (8)| 00:00:01 |
|* 98 | TABLE ACCESS FULL |
PER_ALL_PEOPLE_F | 13 | 533 | 5 (0)| 00:00:01 |
|* 99 | HASH JOIN |
| 381 | 29337 | 20 (10)| 00:00:01 |
| 100 | TABLE ACCESS FULL | PO_AGENTS
| 8 | 136 | 5 (0)| 00:00:01 |
| 101 | MERGE JOIN |
| 381 | 22860 | 14 (8)| 00:00:01 |
| 102 | TABLE ACCESS BY INDEX ROWID| AP_SUPPLIERS
| 5 | 110 | 4 (0)| 00:00:01 |
| 103 | INDEX FULL SCAN | AP_SUPPLIERS_U1
| 5 | | 1 (0)| 00:00:01 |
|*104 | SORT JOIN |
| 382 | 14516 | 10 (10)| 00:00:01 |
| 105 | TABLE ACCESS FULL | PO_HEADERS_ALL
| 382 | 14516 | 9 (0)| 00:00:01 |
|*106 | INDEX UNIQUE SCAN |
HR_LOCATIONS_ALL_TL_PK | 1 | 7 | 0 (0)| 00:00:01 |
|*107 | TABLE ACCESS FULL |
RCV_TRANSACTIONS | 1501 | 134K| 39 (3)| 00:00:01 |
|*108 | INDEX UNIQUE SCAN |
MTL_PARAMETERS_U1 | 1 | 4 | 0 (0)| 00:00:01 |
|*109 | INDEX UNIQUE SCAN |
PO_LINE_TYPES_B_U1 | 1 | 3 | 0 (0)| 00:00:01 |
|*110 | INDEX UNIQUE SCAN |
HR_ORGANIZATION_UNITS_PK | 1 | 4 | 0 (0)| 00:00:01 |
| 111 | TABLE ACCESS BY INDEX ROWID |
RCV_TRANSACTIONS | 1 | 22 | 1 (0)| 00:00:01 |
|*112 | INDEX UNIQUE SCAN |
RCV_TRANSACTIONS_U1 | 1 | | 0 (0)| 00:00:01 |
-----------------------------------------------------------------------------------
---------------------------------------------------------

Predicate Information (identified by operation id):


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

2 -
access("INVENTORY_ITEM_ID"=:B1 AND "ORGANIZATION_ID"=:B2)
4 -
filter("XX"."ITEM_ID"=:B1)
6 -
access("RT1"."TRANSACTION_ID"="RT1"."TRANSACTION_ID")
8 -
access("RT1"."TRANSACTION_ID"="RT1"."TRANSACTION_ID")
10 -
access("RT1"."PO_LINE_ID"="PLA1"."PO_LINE_ID")
12 -
access("RT1"."PO_HEADER_ID"="PHA1"."PO_HEADER_ID")
16 -
access("PHA1"."VENDOR_ID"="APS1"."VENDOR_ID")
filter("PHA1"."VENDOR_ID"="APS1"."VENDOR_ID")
18 - access(ROWID=ROWID)
26 - access("GL"."LEDGER_ID"=TO_NUMBER("O3"."ORG_INFORMATION3"))
28 - access("O"."ORGANIZATION_ID"="OTL"."ORGANIZATION_ID")
30 - access(ROWID=ROWID)
31 - access("OTL"."LANGUAGE"=USERENV('LANG'))
32 - filter("OTL"."LANGUAGE"=USERENV('LANG'))
33 - access("O"."ORGANIZATION_ID"="O2"."ORGANIZATION_ID")
34 - filter("O2"."ORG_INFORMATION1"='OPERATING_UNIT' AND
"O2"."ORG_INFORMATION2"='Y' AND
"O2"."ORG_INFORMATION_CONTEXT"||''='CLASS')
35 - access("O"."ORGANIZATION_ID"="O3"."ORGANIZATION_ID")
37 - access("O3"."ORG_INFORMATION_CONTEXT"='Operating Unit Information')
39 -
access("LGR"."LEDGER_ID"=TO_NUMBER(DECODE(RTRIM(TRANSLATE("HOI2"."ORG_INFORMATION1"
,'0123456789','
')),NULL,"HOI2"."ORG_INFORMATION1",'-99999')))
40 - filter(NVL("LGR"."COMPLETE_FLAG",'Y')='Y' AND "LGR"."OBJECT_TYPE_CODE"='L')
41 - access("RT1"."TRANSACTION_ID"="SYS_ALIAS_1"."TRANSACTION_ID")
43 - access("PLL"."SHIP_TO_LOCATION_ID"="HLA"."LOCATION_ID")
45 - access("SYS_ALIAS_1"."PO_LINE_LOCATION_ID"="PLL"."LINE_LOCATION_ID")
47 - access("SYS_ALIAS_3"."CATEGORY_ID"="CATEGORY_ID")
49 - access("YY"."ITEM_ID"="SYS_ALIAS_3"."ITEM_ID")
54 - filter(TO_DATE('01-JAN-16','DD-MON-YY')<=TO_DATE('30-DEC-16','DD-MON-YY'))
55 - access("RT1"."TRANSACTION_ID"="RT1"."TRANSACTION_ID")
57 - access("RT1"."TRANSACTION_ID"="RT1"."TRANSACTION_ID")
59 - access("RT1"."PO_LINE_ID"="PLA1"."PO_LINE_ID")
61 - access("RT1"."PO_HEADER_ID"="PHA1"."PO_HEADER_ID")
65 - access("PHA1"."VENDOR_ID"="APS1"."VENDOR_ID")
filter("PHA1"."VENDOR_ID"="APS1"."VENDOR_ID")
67 - access(ROWID=ROWID)
71 - access("B"."LINE_TYPE_ID"="T"."LINE_TYPE_ID")
73 - access(ROWID=ROWID)
74 - filter("T"."LANGUAGE"=USERENV('LANG'))
75 - filter("T"."LANGUAGE"=USERENV('LANG'))
77 - access("SYS_ALIAS_1"."PO_LINE_ID"="SYS_ALIAS_3"."PO_LINE_ID")
79 - access("SYS_ALIAS_1"."SHIPMENT_HEADER_ID"="RSH"."SHIPMENT_HEADER_ID")
81 - access("HAO"."ORGANIZATION_ID"="HAOTL"."ORGANIZATION_ID")
82 - access("HAOTL"."LANGUAGE"=USERENV('LANG'))

filter(DECODE("HR_SECURITY"."VIEW_ALL"(),'Y','TRUE',"HR_SECURITY"."SHOW_RECORD"('HR
_ALL_ORGANIZATION_UNITS',"HAOTL"."ORGANIZA
TION_ID"))='TRUE' AND "HAOTL"."LANGUAGE"=USERENV('LANG'))
83 - access("HAO"."ORGANIZATION_ID"="HOI1"."ORGANIZATION_ID")
84 - filter("HOI1"."ORG_INFORMATION1"='INV' AND "HOI1"."ORG_INFORMATION2"='Y' AND
"HOI1"."ORG_INFORMATION_CONTEXT"||''='CLASS')
85 - access("HAO"."ORGANIZATION_ID"="HOI2"."ORGANIZATION_ID")
86 - filter("HOI2"."ORG_INFORMATION_CONTEXT"||''='Accounting Information')
88 - access("SYS_ALIAS_1"."ORGANIZATION_ID"="HAO"."ORGANIZATION_ID")
89 -
filter("HAO"."BUSINESS_GROUP_ID"=DECODE("HR_GENERAL"."GET_XBG_PROFILE"(),'Y',"HAO".
"BUSINESS_GROUP_ID","HR_GENERAL"."GET_BUSI
NESS_GROUP_ID"()))
90 - access(ROWID=ROWID)
93 - access("SYS_ALIAS_1"."VENDOR_SITE_ID"="APSS"."VENDOR_SITE_ID" AND
"SYS_ALIAS_1"."VENDOR_ID"="APSS"."VENDOR_ID")
95 - access("SYS_ALIAS_1"."PO_HEADER_ID"="PHA"."PO_HEADER_ID")
97 - access("PA"."AGENT_ID"="PAPF"."PERSON_ID")
98 -
filter("PAPF"."BUSINESS_GROUP_ID"=DECODE("HR_GENERAL"."GET_XBG_PROFILE"(),'Y',"PAPF
"."BUSINESS_GROUP_ID","HR_GENERAL"."GET_BU
SINESS_GROUP_ID"()) AND
"PAPF"."EFFECTIVE_START_DATE"<=TRUNC(SYSDATE@!) AND
"PAPF"."EFFECTIVE_END_DATE">=TRUNC(SYSDATE@!))
99 - access("PHA"."AGENT_ID"="PA"."AGENT_ID")
104 - access("PHA"."VENDOR_ID"="APS"."VENDOR_ID")
filter("PHA"."VENDOR_ID"="APS"."VENDOR_ID")
106 - access("PA"."LOCATION_ID"="HL"."LOCATION_ID"(+) AND
"HL"."LANGUAGE"(+)=USERENV('LANG'))
107 -
filter(TRUNC(INTERNAL_FUNCTION("SYS_ALIAS_1"."TRANSACTION_DATE"))>=TO_DATE('01-JAN-
16','DD-MON-YY') AND

TRUNC(INTERNAL_FUNCTION("SYS_ALIAS_1"."TRANSACTION_DATE"))<=TO_DATE('30-DEC-
16','DD-MON-YY') AND
("SYS_ALIAS_1"."TRANSACTION_TYPE"='RECEIVE' OR
"SYS_ALIAS_1"."TRANSACTION_TYPE"='RETURN TO VENDOR'))
108 - access("HAO"."ORGANIZATION_ID"="MP"."ORGANIZATION_ID")
109 - access("SYS_ALIAS_3"."LINE_TYPE_ID"="B"."LINE_TYPE_ID")
110 -
access("O"."ORGANIZATION_ID"=DECODE("HOI2"."ORG_INFORMATION_CONTEXT",'Accounting
Information',TO_NUMBER("HOI2"."ORG_INFORMATION3"),TO_NUMBER(NULL)))
112 - access("RT1"."TRANSACTION_ID"="SYS_ALIAS_1"."TRANSACTION_ID")

-------------------------------------------------------------------------------
');