Performance worse for given workflow query [message #652918] |
Wed, 22 June 2016 05:59 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](//www.gravatar.com/avatar/33f5ecad352bc1b0870d0040e270378d?s=64&d=mm&r=g) |
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 #652947 is a reply to message #652946] |
Wed, 22 June 2016 09:43 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
OP may well have not written the SQL but if he doesn't understand what it does and what the relationships between the underlying tables are, he shouldn't be trying to tune it.
And unless someone tells the rest of us what the table structures are and what the relationships between them are, the amount of help we can give will be limited.
|
|
|
|
Re: Performance worse for given workflow query [message #652949 is a reply to message #652947] |
Wed, 22 June 2016 09:48 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
John Watson
Messages: 8964 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
|
|
|