Performance worse for given workflow query [message #652918] |
Wed, 22 June 2016 05:59  |
 |
nishant87
Messages: 53 Registered: September 2013 Location: india
|
Member |
|
|
Hi,
Below is the query which is performing badly in production and consuming high LIO also.
SELECT s.item_type,
s.item_key,
p.process_name,
p.activity_name,
p.process_version,
p.activity_item_type
FROM wf_item_activity_statuses S,
wf_process_activities P
WHERE p.instance_id = s.process_activity
AND s.item_type = :B3
AND p.activity_item_type = s.item_type
AND p.process_name = Nvl (:B2 , p.process_name)
AND p.activity_name = 'LINE_SCHEDULING'
AND s.item_key = Nvl (:B1 , s.item_key)
AND s.activity_status = 'COMPLETE'
AND EXISTS
(
SELECT 1
FROM wf_item_activity_statuses_h S1,
wf_process_activities P1
WHERE p1.instance_id = s1.process_activity
AND s1.item_type = :B3
AND s1.item_type = s.item_type
AND s1.item_key = s.item_key
AND p1.activity_item_type = s1.item_type
AND p1.process_name = Nvl (:B2 , p1.process_name)
AND s1.begin_date <= (sysdate - :B6 )
AND p1.activity_name = :B5
AND p1.process_version = p.process_version
AND s1.item_key = Nvl (:B1 , s1.item_key)
AND s1.activity_status = :B4 )
I tried scanning wf_item_activity_statuses_h first but it didn't work.
i am attaching trace file also.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Performance worse for given workflow query [message #652949 is a reply to message #652947] |
Wed, 22 June 2016 09:48  |
John Watson
Messages: 8988 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
The table structures and relationships are all on etrm.oracle.com, for example,Table: WF_ITEM_ACTIVITY_STATUSES
Product: FND - Application Object Library
Description: Runtime table for a work item
Implementation/DBA Data: TableAPPLSYS.WF_ITEM_ACTIVITY_STATUSES
Primary Key: WF_ITEM_ACTIVITY_STATUSES_PK
ColumnITEM_TYPE
ColumnITEM_KEY
ColumnPROCESS_ACTIVITY
Foreign Keys
Table
Foreign Table Foreign Key Column
WF_ITEM_ACTIVITY_STATUSES FK Joins to TableWF_ITEMS WF_ITEM_ACTIVITY_STATUSES.ITEM_TYPE
WF_ITEM_ACTIVITY_STATUSES.ITEM_KEY
WF_ITEM_ACTIVITY_STATUSES FK Joins to TableWF_PROCESS_ACTIVITIES WF_ITEM_ACTIVITY_STATUSES.PROCESS_ACTIVITY
WF_ITEM_ACTIVITY_STATUSES FK Joins to TableWF_NOTIFICATIONS WF_ITEM_ACTIVITY_STATUSES.NOTIFICATION_ID
|
|
|