Performance tune
Hi Everyone i am using the following procedure to get Distribution List in a cursor
CREATE OR REPLACE PACKAGE BODY Pk_Outage_Target_Dls AS
-- global Variables used in procedures
v_results_cur VARCHAR2(40);
V_CONCAT_RES VARCHAR2(2000);
V_APPLN_ASSET_ID VARCHAR2(2000);
V_SERVER_IMG_ASSET_ID VARCHAR2(2000);
NAME: FN_IN_LIST
Purpose: To get the table of values to pass to cursor query
FUNCTION FN_IN_LIST(p_string IN VARCHAR2) RETURN myTableType AS
v_l_string LONG DEFAULT p_string || ',';
v_l_data myTableType := myTableType();
v_n NUMBER;
BEGIN
LOOP
EXIT WHEN v_l_string IS NULL;
v_n := INSTR(v_l_string, ',');
v_l_data.EXTEND;
v_l_data(v_l_data.COUNT) := LTRIM(RTRIM(SUBSTR(v_l_string, 1, v_n - 1)));
v_l_string := SUBSTR(v_l_string, v_n + 1);
END LOOP;
RETURN v_l_data;
END FN_IN_LIST;
NAME: PROC_GET_ASSET_CLASS
Purpose: To set the v_scope_name for the given asset_id
PROCEDURE PROC_GET_ASSET_CLASS(P_ASSET_ID IN VARCHAR2,
P_SCOPE_NAME OUT VARCHAR2) AS
v_scope_name VARCHAR2(200);
BEGIN
SELECT ATPT.NAME
INTO v_scope_name
FROM T_ASSET_TYPE ATP, T_RELATED_ASSET_TYPE RATP, T_ASSET_TYPE ATPT
WHERE LOWER(ATP.CATEGORY) = LOWER('HIERARCHY')
AND ATP.ASSET_TYPE_ID = RATP.ASSET_TYPE_ID
AND LOWER(RATP.REL_TYPE) = LOWER('SCOPE')
AND RATP.RELATED_ASSET_TYPE_ID = ATPT.ASSET_TYPE_ID
AND ATPT.ACTIVE_FLAG = 1
AND ATP.ASSET_TYPE_ID IN
(SELECT ASSET_TYPE_ID FROM T_ASSET WHERE ASSET_ID = P_ASSET_ID);
P_SCOPE_NAME := v_scope_name;
EXCEPTION
WHEN NO_DATA_FOUND THEN
P_SCOPE_NAME := NULL;
WHEN OTHERS THEN
P_SCOPE_NAME := NULL;
END PROC_GET_ASSET_CLASS;
NAME: PROC_HARDWARE_SCOPE
Purpose: For processing when "server hardware scope"
PROCEDURE PROC_HARDWARE_SCOPE(P_ASSET_ID IN VARCHAR2,
CUR_DL_LIST OUT REFCURSORTYPE,
P_ERROR_CODE OUT VARCHAR2) AS
V_CUR_SERVER_IMG REFCURSORTYPE;
V_CUR_APPLN_ASSET REFCURSORTYPE;
BEGIN
-- get the server image(s) asset ids on the hardware
OPEN V_CUR_SERVER_IMG FOR
SELECT A.ASSET_ID
FROM T_ASSET A, T_RELATED_ASSET B
WHERE A.ACTIVE_FLAG = 1
AND LOWER(A.STATUS) <> LOWER('Inactive')
AND B.ASSET_ID = A.ASSET_ID
AND B.ACTIVE_FLAG = 1
AND LOWER(B.REL_TYPE) = 'server hardware'
AND B.RELATED_ASSET_ID = P_ASSET_ID;
V_SERVER_IMG_ASSET_ID := '';
LOOP
FETCH V_CUR_SERVER_IMG
INTO v_results_cur;
EXIT WHEN V_CUR_SERVER_IMG%NOTFOUND;
V_SERVER_IMG_ASSET_ID := V_SERVER_IMG_ASSET_ID || v_results_cur || ',';
END LOOP;
CLOSE V_CUR_SERVER_IMG;
-- DBMS_OUTPUT.PUT_LINE('P_ASSET_ID = ' || P_ASSET_ID);
-- DBMS_OUTPUT.PUT_LINE('V_SERVER_IMG_ASSET_ID=' || V_SERVER_IMG_ASSET_ID);
IF V_SERVER_IMG_ASSET_ID IS NOT NULL THEN
V_SERVER_IMG_ASSET_ID := SUBSTR(V_SERVER_IMG_ASSET_ID, 1, LENGTH(V_SERVER_IMG_ASSET_ID) - 1);
END IF;
-- get the application assets ids for each server image ids
OPEN V_CUR_APPLN_ASSET FOR
SELECT A.ASSET_ID
FROM T_ASSET A, T_RELATED_ASSET B
WHERE A.ACTIVE_FLAG = 1
AND LOWER(A.STATUS) <> LOWER('Inactive')
AND B.RELATED_ASSET_ID = A.ASSET_ID
AND B.ACTIVE_FLAG = 1
AND LOWER(B.REL_TYPE) = 'application'
AND B.ASSET_ID IN
(SELECT * FROM THE (SELECT cast(FN_IN_LIST(V_SERVER_IMG_ASSET_ID) AS mytableType) FROM dual));
V_APPLN_ASSET_ID := '';
LOOP
FETCH V_CUR_APPLN_ASSET
INTO v_results_cur;
EXIT WHEN V_CUR_APPLN_ASSET%NOTFOUND;
V_APPLN_ASSET_ID := V_APPLN_ASSET_ID || v_results_cur || ',';
END LOOP;
CLOSE V_CUR_APPLN_ASSET;
-- DBMS_OUTPUT.PUT_LINE('V_APPLN_ASSET_ID = ' || V_APPLN_ASSET_ID);
V_CONCAT_RES := V_SERVER_IMG_ASSET_ID ||','|| V_APPLN_ASSET_ID||P_ASSET_ID;
-- DBMS_OUTPUT.PUT_LINE('v_concat_res = ' || V_CONCAT_RES);
-- get DL ID & DL Name for the application assets ids
OPEN CUR_DL_LIST FOR
SELECT DISTINCT ATO.ORG_Id, ORG.ORG_NAME
FROM T_ASSET_ORG_ROLE ATO, T_ORG ORG
WHERE ATO.ORG_ID = ORG.ORG_ID
AND ATO.ACTIVE_FLAG = 1
AND ATO.ROLE_ID IN (19, 150, 54)
Start Added By Naval Pant
AND ATO.ASSET_ID IN
(SELECT * FROM THE (SELECT cast(FN_IN_LIST(V_CONCAT_RES) AS mytableType) FROM dual))
End Added By Naval Pant
AND ORG.ACTIVE_FLAG = 1 ORDER BY ORG.ORG_NAME;
P_ERROR_CODE := 'NO_ERROR';
EXCEPTION
WHEN NO_DATA_FOUND THEN
V_SERVER_IMG_ASSET_ID := NULL;
V_APPLN_ASSET_ID := NULL;
P_ERROR_CODE := 'NO DATA FOUND in Hardware Scope: ' ||
SQLCODE || ' ; ' || SQLERRM;
WHEN OTHERS THEN
V_SERVER_IMG_ASSET_ID := NULL;
V_APPLN_ASSET_ID := NULL;
P_ERROR_CODE := 'INVALID DATA in Hardware Scope: ' ||
SQLCODE || ' ; ' || SQLERRM;
END PROC_HARDWARE_SCOPE;
NAME: PROC_SOFTWARE_SCOPE
Purpose: For processing when "server software scope"
PROCEDURE PROC_SOFTWARE_SCOPE(P_ASSET_ID VARCHAR2,
CUR_DL_LIST OUT REFCURSORTYPE,
P_ERROR_CODE OUT VARCHAR2) AS
V_CUR_APPLN_ASSET REFCURSORTYPE;
BEGIN
-- get the application assets ids for each server image asset id.
OPEN V_CUR_APPLN_ASSET FOR
SELECT A.ASSET_ID
FROM T_ASSET A, T_RELATED_ASSET B
WHERE A.ACTIVE_FLAG = 1
AND LOWER(A.STATUS) <> LOWER('Inactive')
AND B.RELATED_ASSET_ID = A.ASSET_ID
AND B.ACTIVE_FLAG = 1
AND LOWER(B.REL_TYPE) = LOWER('Application')
AND B.ASSET_ID = P_ASSET_ID;
V_APPLN_ASSET_ID := '';
LOOP
FETCH V_CUR_APPLN_ASSET
INTO v_results_cur;
EXIT WHEN V_CUR_APPLN_ASSET%NOTFOUND;
V_APPLN_ASSET_ID := V_APPLN_ASSET_ID ||v_results_cur ||',';
END LOOP;
CLOSE V_CUR_APPLN_ASSET;
-- DBMS_OUTPUT.PUT_LINE('V_APPLN_ASSET_ID =' || V_APPLN_ASSET_ID);
--DBMS_OUTPUT.PUT_LINE('P_ASSET_ID =' || P_ASSET_ID);
V_CONCAT_RES := V_APPLN_ASSET_ID||P_ASSET_ID ;
-- DBMS_OUTPUT.PUT_LINE('V_CONCAT_RES = ' || V_CONCAT_RES);
-- get DL ID & DL Name for the application assets ids
OPEN CUR_DL_LIST FOR
SELECT DISTINCT ATO.ORG_Id, ORG.ORG_NAME
FROM T_ASSET_ORG_ROLE ATO, T_ORG ORG
WHERE ATO.ORG_ID = ORG.ORG_ID
AND ATO.ACTIVE_FLAG = 1
AND ATO.ROLE_ID IN (19, 150, 54)
Start Added By Naval Pant
AND ATO.ASSET_ID IN
(SELECT * FROM THE (SELECT cast(FN_IN_LIST(V_CONCAT_RES) AS mytableType) FROM dual))
End Added By Naval Pant
AND ORG.ACTIVE_FLAG = 1 ORDER BY ORG.ORG_NAME;
P_ERROR_CODE := 'NO_ERROR';
EXCEPTION
WHEN NO_DATA_FOUND THEN
V_APPLN_ASSET_ID := NULL;
P_ERROR_CODE := 'NO DATA FOUND in Software Scope : ' || SQLCODE ||
' ; ' || SQLERRM;
WHEN OTHERS THEN
V_APPLN_ASSET_ID := NULL;
P_ERROR_CODE := 'INVALID DATA in Software Scope : ' || SQLCODE ||
' ; ' || SQLERRM;
END PROC_SOFTWARE_SCOPE;
NAME: PROC_APPLICATION_SCOPE
Purpose: For processing when asset is of type "application scope"
PROCEDURE PROC_APPLICATION_SCOPE(P_ASSET_ID VARCHAR2,
CUR_DL_LIST OUT REFCURSORTYPE,
P_ERROR_CODE OUT VARCHAR2) AS
BEGIN
-- get DL ID & DL Name for the application asset id
OPEN CUR_DL_LIST FOR
SELECT DISTINCT ATO.ORG_Id, ORG.ORG_NAME
FROM T_ASSET_ORG_ROLE ATO, T_ORG ORG
WHERE ATO.ORG_ID = ORG.ORG_ID
AND ATO.ACTIVE_FLAG = 1
AND ATO.ROLE_ID IN (19, 150, 54)
AND ATO.ASSET_ID IN (P_ASSET_ID)
AND ORG.ACTIVE_FLAG = 1 ORDER BY ORG.ORG_NAME;
P_ERROR_CODE := 'NO_ERROR';
EXCEPTION
WHEN NO_DATA_FOUND THEN
P_ERROR_CODE := 'NO DATA FOUND in Application Scope : ' || SQLCODE ||
' ; ' || SQLERRM;
WHEN OTHERS THEN
P_ERROR_CODE := 'INVALID DATA in Application Scope : ' || SQLCODE ||
' ; ' || SQLERRM;
END PROC_APPLICATION_SCOPE;
NAME: PROC_OTHER_SCOPE
Purpose: For processing when asset is not of type "hardware,software,application" scope
PROCEDURE PROC_OTHER_SCOPE(P_ASSET_ID VARCHAR2,
CUR_DL_LIST OUT REFCURSORTYPE,
P_ERROR_CODE OUT VARCHAR2) AS
BEGIN
-- get DL ID & DL Name for the application asset id
OPEN CUR_DL_LIST FOR
SELECT DISTINCT ATO.ORG_Id, ORG.ORG_NAME
FROM T_ASSET_ORG_ROLE ATO, T_ORG ORG
WHERE ATO.ORG_ID = ORG.ORG_ID
AND ATO.ACTIVE_FLAG = 1
AND ATO.ROLE_ID IN (19, 54)
AND ATO.ASSET_ID IN (P_ASSET_ID)
AND ORG.ACTIVE_FLAG = 1 ORDER BY ORG.ORG_NAME;
P_ERROR_CODE := 'NO_ERROR';
EXCEPTION
WHEN NO_DATA_FOUND THEN
P_ERROR_CODE := 'NO DATA FOUND in Other Scope : ' || SQLCODE || ' ; ' ||
SQLERRM;
WHEN OTHERS THEN
P_ERROR_CODE := 'INVALID DATA in Other Scope : ' || SQLCODE || ' ; ' ||
SQLERRM;
END PROC_OTHER_SCOPE;
NAME: PROC_OUTAGE_TARGET_DLS
Purpose: Main Proc to fetch DL Lists
PROCEDURE PROC_OUTAGE_TARGET_DLS(P_ASSET_ID IN VARCHAR2,
CUR_DL_LIST OUT REFCURSORTYPE,
P_ERROR_CODE OUT VARCHAR2) AS
v_scope_name VARCHAR2(200);
BEGIN
P_ERROR_CODE := 'NO_ERROR';
PROC_GET_ASSET_CLASS(P_ASSET_ID, v_scope_name);
-- DBMS_OUTPUT.PUT_LINE('SCOPE OF ASSET : ' || v_scope_name);
IF (LOWER(v_scope_name) = 'server hardware scope') THEN
PROC_HARDWARE_SCOPE(P_ASSET_ID, CUR_DL_LIST, P_ERROR_CODE);
ELSIF (LOWER(v_scope_name) = 'server software scope') THEN
PROC_SOFTWARE_SCOPE(P_ASSET_ID, CUR_DL_LIST, P_ERROR_CODE);
ELSIF (LOWER(v_scope_name) = 'application scope') THEN
PROC_APPLICATION_SCOPE(P_ASSET_ID, CUR_DL_LIST, P_ERROR_CODE);
ELSE
PROC_OTHER_SCOPE(P_ASSET_ID, CUR_DL_LIST, P_ERROR_CODE);
END IF;
EXCEPTION
WHEN NO_DATA_FOUND THEN
P_ERROR_CODE := 'NO DATA FOUND : OUTAGE_TARGET_DLS ' || SQLCODE ||
' ; ' || SQLERRM;
WHEN OTHERS THEN
P_ERROR_CODE := 'INVALID DATA : OUTAGE_TARGET_DLS ' || SQLCODE ||
' ; ' || SQLERRM;
END PROC_OUTAGE_TARGET_DLS;
END Pk_Outage_Target_Dls;
when i am executing the procedure, it's taking huge time i.e 6 - 72 seconds.
i want this time to be under 1 second. But i don't know what's the performance issue in the above.
If anyone can tell me that would be great help for me.
waiting for your reply, suggestion.........
First of all the varying run times of "the" procedure that you execute (I assume it is PROC_OUTAGE_TARGET_DLS) is probably caused by the fact that it in turn calls four different procedures depending on the input value.
It probably won't help you much since you say you are Java developer, but I think that the PROC_HARDWARE_SCOPE and PROC_SOFTWARE_SCOPE procedure of your package are far too convoluted and should be simplified... In particular the usage of the FN_IN_LIST table function is in my opinion unnecessary, because I think all these separate steps performed in the procedures to generate a comma separated list of strings which is then in turn transformed into rows again should be done in a single SQL using simple IN subqueries or even joins without the prior concatenation of strings in a list.
E.g. the final cursor opened in PROC_HARDWARE_SCOPE could look like the following:
SELECT DISTINCT ATO.ORG_Id, ORG.ORG_NAME
FROM T_ASSET_ORG_ROLE ATO, T_ORG ORG
WHERE ATO.ORG_ID = ORG.ORG_ID
AND ATO.ACTIVE_FLAG = 1
AND ATO.ROLE_ID IN (19, 150, 54)
Start Added By Naval Pant
AND ATO.ASSET_ID IN
SELECT A.ASSET_ID
FROM T_ASSET A, T_RELATED_ASSET B
WHERE A.ACTIVE_FLAG = 1
AND LOWER(A.STATUS) <> LOWER('Inactive')
AND B.RELATED_ASSET_ID = A.ASSET_ID
AND B.ACTIVE_FLAG = 1
AND LOWER(B.REL_TYPE) = 'application'
AND B.ASSET_ID IN
SELECT A.ASSET_ID
FROM T_ASSET A, T_RELATED_ASSET B
WHERE A.ACTIVE_FLAG = 1
AND LOWER(A.STATUS) <> LOWER('Inactive')
AND B.ASSET_ID = A.ASSET_ID
AND B.ACTIVE_FLAG = 1
AND LOWER(B.REL_TYPE) = 'server hardware'
AND B.RELATED_ASSET_ID = P_ASSET_ID
UNION ALL
SELECT P_ASSET_ID FROM DUAL
End Added By Naval Pant
AND ORG.ACTIVE_FLAG = 1 ORDER BY ORG.ORG_NAME;Since you're saying that even in best case you still get a run time of 6 seconds that you want to reduce to 1 second I assume that you'll have to tune all these queries in addition to the simplification, because if a rather simple query like this, taken from PROC_APPLICATION_SCOPE:
SELECT DISTINCT ATO.ORG_Id, ORG.ORG_NAME
FROM T_ASSET_ORG_ROLE ATO, T_ORG ORG
WHERE ATO.ORG_ID = ORG.ORG_ID
AND ATO.ACTIVE_FLAG = 1
AND ATO.ROLE_ID IN (19, 150, 54)
AND ATO.ASSET_ID IN (P_ASSET_ID)
AND ORG.ACTIVE_FLAG = 1 ORDER BY ORG.ORG_NAME;takes more than one second you need to find out why and whether it's possible to retrieve that information quicker.
Note that all queries use a DISTINCT operator which indicates that there might something be wrong with the data model and/or the query because it seems to eliminate duplicates. May be you want to run the queries without distinct to find out what the result then looks like. You might find out that you get a tremendous result set consisting of many duplicates and most of the time is spent by the database on removing them.
Regards,
Randolf
Oracle related stuff blog:
http://oracle-randolf.blogspot.com/
SQLTools++ for Oracle:
http://www.sqltools-plusplus.org:7676/
http://sourceforge.net/projects/sqlt-pp/
Similar Messages
-
Hi friends,
I am himansu, i am facing a problem during performance tunning of query in oracle , please guide me how to tune a query which will give better performance.907977 wrote:
Hi friends,
I am himansu, i am facing a problem during performance tunning of query in oracle , please guide me how to tune a query which will give better performance.Welcome to OTN
Please post your thread at SQL, PL/SQL. PL/SQL
and provide your sql query.
Hope this will help you. -
Performance tunning in exraction.
hii frnds,
can anyone plz tell me the performance tunning in extraction,in report,in dataloading.plz reply me in pointwise..
Thanks
Rosy
Please search for available information before posting.
Edited by: kishan P on Jan 24, 2012 10:57 AMHi Rosy,
Please check the below docs,
http://www.tli-usa.com/download/Expert_Tips_and_New_Techniques_for_Optimizing_Data_Load_and_Query_Performance__Part_One_.pdf
http://www.tli-usa.com/download/Expert_Tips_and_New_Techniques_for_Optimizing_Data_Load_and_Query_Performance__Part_Two_.pdf
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/08f1b622-0c01-0010-618c-cb41e12c72be?QuickLink=index&overridelayout=true
Thanks,
Vinod -
Performance Tunning in weblogic
Hi All,
Can you please tell me about performance tunning in weblogic server in simple way to understand. I have gone through Pdf's but some what difficult to understand .
Thanks
Balaji kumarthe only serious approach to performance tuning is:
- write scripts who geneerate load on your system
- profile your system under load using a profiler such as yourkit or jrockit mission control
- monitor your application (ejb pools, datasources, jvm, threads9 under load to detect any bottleneck
- analyze logs under load to determine any saturation in resource usage
most default parameters of weblogic are already optimized for general purpose usage.
but every application if different from the other, so you must do your own homework -
Need help for performance tunning
Hello,
I have 16K records return by query, it takes long time to proceed for 7K it takes 7.5 sec.
Note: I used all seeded tables only.
If possible please help me to tune it.
SELECT msi.inventory_item_id,msi.segment1,msi.rimary_uom_code , msi.primary_unit_of_measure
FROM mtl_system_items_b msi, qp_list_lines qpll,qp_pricing_attributes qppr,
mtl_category_sets_tl mcs,mtl_category_sets_b mcsb,
mtl_categories_b mc, mtl_item_categories mcb
WHERE msi.enabled_flag = 'Y'
AND qpll.list_line_id = qppr.list_line_id
AND qppr.product_attr_value = TO_CHAR (msi.inventory_item_id(+))
AND qppr.product_uom_code = msi.primary_uom_code
AND mc.category_id = mcb.category_id
AND msi.inventory_item_id = mcb.inventory_item_id
AND msi.organization_id = mcb.organization_id
AND TRUNC (SYSDATE) BETWEEN NVL (qpll.start_date_active,TRUNC (SYSDATE)) AND NVL (qpll.end_date_active,TRUNC (SYSDATE))
AND mcs.category_set_name = 'LSS SALES CATEGORY'
AND mcs.language = 'US'
AND mcs.category_set_id = mcsb.category_set_id
AND mcsb.structure_id = mc.structure_id
AND msi.organization_id = :p_organization_id
AND qpll.list_header_id = :p_price_list_id
AND mcb.category_id = :p_category_id;
Thanks and regards
Akil.Thanks Helios ,
here is answers
Databse version
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit
PL/SQL Release 11.1.0.7.0
explain plan
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
|
0 | SELECT STATEMENT
| |
1 | 149 | 9439
(1)|
|
1 | NESTED LOOPS | | 1 |
149 | 9439 (1)|
|*
2 | HASH JOIN OUTER | | 1 |
135 | 9437 (1)|
|*
3 | HASH JOIN | | 1 |
71 | 9432 (1)|
|
4 | NESTED LOOPS | | 2 |
76 | 53 (0)|
|*
5 | TABLE ACCESS BY INDEX
ROWID| QP_LIST_LINES | 2 |
44 | 49 (0)|
|*
6 | INDEX SKIP SCAN | QP_LIST_LINES_N2 |
702 | | 20
(0)|
|*
7 | INDEX RANGE SCAN | QP_PRICING_ATTRIBUTES_N3 | 1 |
16 | 2 (0)|
|*
8 | TABLE ACCESS BY INDEX
ROWID | MTL_SYSTEM_ITEMS_B | 46254
| 1490K|
9378 (1)|
|*
9 | INDEX RANGE SCAN | MTL_SYSTEM_ITEMS_B_N9 | 46254 | |
174 (1)|
|
10 | TABLE ACCESS FULL | XX_WEB_ITEM_IMAGE_TBL |
277 | 17728 | 5 (0)|
|* 11 | INDEX RANGE SCAN | MTL_ITEM_CATEGORIES_U1 |
1 | 14 | 2
(0)|
Predicate Information (identified
by operation id):
2 -
access("XWIIT"."IMAGE_CODE"(+)="MSI"."SEGMENT1")
3 -
access("QPPR"."PRODUCT_ATTR_VALUE"=TO_CHAR("MSI"."INVENTORY_ITEM_ID")
AND
"QPPR"."PRODUCT_UOM_CODE"="MSI"."PRIMARY_UOM_CODE")
5 - filter(NVL("QPLL"."START_DATE_ACTIVE",TRUNC(SYSDATE@!))<=TRUNC(SYSDATE@!)
AND
NVL("QPLL"."END_DATE_ACTIVE",TRUNC(SYSDATE@!))>=TRUNC(SYSDATE@!))
6 -
access("QPLL"."LIST_HEADER_ID"=TO_NUMBER(:P_PRICE_LIST_ID))
filter("QPLL"."LIST_HEADER_ID"=TO_NUMBER(:P_PRICE_LIST_ID))
7 -
access("QPLL"."LIST_LINE_ID"="QPPR"."LIST_LINE_ID")
filter("QPPR"."PRODUCT_UOM_CODE" IS NOT NULL)
8 - filter("MSI"."ENABLED_FLAG"='Y')
9 - access("MSI"."ORGANIZATION_ID"=TO_NUMBER(:P_ORGANIZATION_ID))
11 -
access("MCB"."ORGANIZATION_ID"=TO_NUMBER(:P_ORGANIZATION_ID)
AND
"MSI"."INVENTORY_ITEM_ID"="MCB"."INVENTORY_ITEM_ID"
AND
"MCB"."CATEGORY_ID"=TO_NUMBER(:P_CATEGORY_ID))
filter("MCB"."CATEGORY_ID"=TO_NUMBER(:P_CATEGORY_ID))
Note
- 'PLAN_TABLE' is old version
TKprof Plan
TKPROF: Release 11.1.0.7.0 - Production on Fri Nov 15 06:12:26 2013
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Trace file: LSSD_ora_19760.trc
Sort options: default
count = number of times OCI procedure was executed
cpu = cpu time in seconds executing
elapsed = elapsed time in seconds executing
disk = number of physical reads of buffers from disk
query = number of buffers gotten for consistent read
current = number of buffers gotten in current mode (usually for update)
rows = number of rows processed by the fetch or execute call
SELECT msi.inventory_item_id,
msi.segment1,
primary_uom_code,
primary_unit_of_measure,
xwiit.image_url
FROM mtl_system_items_b msi,
qp_list_lines qpll,
qp_pricing_attributes qppr,
mtl_item_categories mcb,
xx_web_item_image_tbl xwiit
WHERE msi.enabled_flag = 'Y'
AND qpll.list_line_id = qppr.list_line_id
AND qppr.product_attr_value = TO_CHAR (msi.inventory_item_id)
AND qppr.product_uom_code = msi.primary_uom_code
AND msi.inventory_item_id = mcb.inventory_item_id
AND msi.organization_id = mcb.organization_id
AND TRUNC (SYSDATE) BETWEEN NVL (qpll.start_date_active,
TRUNC (SYSDATE))
AND NVL (qpll.end_date_active,
TRUNC (SYSDATE))
AND xwiit.image_code(+) = msi.segment1
AND msi.organization_id = :p_organization_id
AND qpll.list_header_id = :p_price_list_id
AND mcb.category_id = :p_category_id
call count cpu elapsed disk query current rows
Parse 2 0.00 0.00 0 0 0 0
Execute 2 0.00 0.00 0 0 0 0
Fetch 2 3.84 3.85 0 432560 0 1002
total 6 3.84 3.85 0 432560 0 1002
Misses in library cache during parse: 0
Optimizer mode: ALL_ROWS
Parsing user id: 173
Rows Row Source Operation
501 NESTED LOOPS (cr=216280 pr=0 pw=0 time=115 us cost=9439 size=149 card=1)
2616 HASH JOIN OUTER (cr=211012 pr=0 pw=0 time=39 us cost=9437 size=135 card=1)
78568 HASH JOIN (cr=210997 pr=0 pw=0 time=3786 us cost=9432 size=71 card=1)
78571 NESTED LOOPS (cr=29229 pr=0 pw=0 time=35533 us cost=53 size=76 card=2)
78571 TABLE ACCESS BY INDEX ROWID QP_LIST_LINES (cr=9943 pr=0 pw=0 time=27533 us cost=49 size=44 card=2)
226733 INDEX SKIP SCAN QP_LIST_LINES_N2 (cr=865 pr=0 pw=0 time=4122 us cost=20 size=0 card=702)(object id 99730)
78571 INDEX RANGE SCAN QP_PRICING_ATTRIBUTES_N3 (cr=19286 pr=0 pw=0 time=0 us cost=2 size=16 card=1)(object id 99733)
128857 TABLE ACCESS BY INDEX ROWID MTL_SYSTEM_ITEMS_B (cr=181768 pr=0 pw=0 time=9580 us cost=9378 size=1526382 card=46254)
128857 INDEX RANGE SCAN MTL_SYSTEM_ITEMS_B_N9 (cr=450 pr=0 pw=0 time=1657 us cost=174 size=0 card=46254)(object id 199728)
277 TABLE ACCESS FULL XX_WEB_ITEM_IMAGE_TBL (cr=15 pr=0 pw=0 time=22 us cost=5 size=17728 card=277)
501 INDEX RANGE SCAN MTL_ITEM_CATEGORIES_U1 (cr=5268 pr=0 pw=0 time=0 us cost=2 size=14 card=1)(object id 99557)
Note: I modified query and it gives good result, now it takes 3 to 4 sec for 16000 records.
If possible can you plz explain what we have to take care while doing performance tunning
I am a fresher so don't have that much idea.
and also Thanks Hussein for your replay -
Unknown steps in performance tunning
Hi,
I am in middle of performance tunning in BI 7.0, as i am going to do the following steps-i am unclear in some steps;
expert advice is needed. post ur ans as soon as possible.
When loading transaction data, following this procedure:
known - Load all master data.
known - Delete the indices of the InfoCube and its aggregates.
Unknown - Turn on number range buffering.
Unknown - Set an appropriate data packet size.
known - Load the transaction data.
known - Re-create the indices.
Unknown - Turn off number range buffering.
known - Refresh the statistics.
regards,
SumanHi Suman,
check these on number range buffering
http://help.sap.com/saphelp_nw04/helpdata/en/7b/6eb2aa7aed44ea92ebb969e03081fb/frameset.htm
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c0a6e3ff-f000-2d10-b59d-8ef35e248f83?quicklink=index&overridelayout=true -
What are the tools in performance Tunning in ABAP/4
Thanks Regards,
KumarHi kumar,
Tools provided for Performance Analysis
Following are the different tools provided by SAP for performance analysis of an ABAP object
Run time analysis transaction SE30
This transaction gives all the analysis of an ABAP program with respect to the database and the non-database processing.
SQL Trace transaction ST05
The trace list has many lines that are not related to the SELECT statement in the ABAP program. This is because the execution of any ABAP program requires additional administrative SQL calls. To restrict the list output, use the filter introducing the trace list.
The trace list contains different SQL statements simultaneously related to the one SELECT statement in the ABAP program. This is because the R/3 Database Interface - a sophisticated component of the R/3 Application Server - maps every Open SQL statement to one or a series of physical database calls and brings it to execution. This mapping, crucial to R/3s performance, depends on the particular call and database system. For example, the SELECT-ENDSELECT loop on the SPFLI table in our test program is mapped to a sequence PREPARE-OPEN-FETCH of physical calls in an Oracle environment.
The WHERE clause in the trace list's SQL statement is different from the WHERE clause in the ABAP statement. This is because in an R/3 system, a client is a self-contained unit with separate master records and its own set of table data (in commercial, organizational, and technical terms). With ABAP, every Open SQL statement automatically executes within the correct client environment. For this reason, a condition with the actual client code is added to every WHERE clause if a client field is a component of the searched table.
To see a statement's execution plan, just position the cursor on the PREPARE statement and choose Explain SQL. A detailed explanation of the execution plan depends on the database system in use.
how to perform sql trace:
Poorly written SQL statements have the greatest impact on application performance. An SQL
statement using which an Oracle database system reads and/or sorts thousands or even millions of
rows of data can bring the database to a standstill. Indexes should be used properly to prevent such
situations from occurring. To analyze such problems you should use the SQL Trace (TCode ST05) to
with database access operations.
CAUTION
Only one person can perform an SQL trace at a time. Remember to turn off the
trace when you are finished. SQL trace slows the system down.
1. Using SQL Trace
1. Open a program that you want to analyze, in the editor, so that it is ready and waiting to be
executed.
2. Open a new session using the menu path System Create session.
3. Run transaction ST05 (enter /nst05-zero-five, not oh-five in the Command field, or choose
the menu path System Utilities Performance Trace).
4. Then the initial screen of the test tool appears.
The status of the Performance Trace is displayed in the lower part of the screen. This status tells you
three things namely
Whether any of the Performance Traces are switched on
The users for whom Performance Trace is enabled
The user that switched the Performance Trace on
If the trace is switched on you must switch it off before you can proceed. There are two cases in
which the trace needs to be switched off. They are
If the trace was started within the past hour, it is possible that it is still being used. Contact the
indicated user or try again later
If the trace was started hours or days ago, the user probably left it on by mistake and it can be
safely turned off
To turn off the trace, press the Trace Off pushbutton.
5. The initial screen has various trace functions such as SQL Trace, Enqueue Trace, RFC
Trace
6. Select SQL Trace.
7. There are various options under which trace can be switched on. They are
If you want to switch on the trace under your user name, choose Trace on.
If you want to switch on the trace for another user or user group, choose Trace on for user.
To enter a single user, specify the user name.
To enter a user group, specify a search pattern (you can use the normal wildcards).
If you want to change the user or user group, switch off the Performance Trace and then restart it,
entering the new users or user group.
8. Now switch back to the window containing your editor session (the one with your program
waiting to be executed).
9. Press F8 to run your program.
Note Just press F8 and do nothing. Do not even press the Back button.
10. When your program has run and the hourglass is no longer displayed, switch back to the trace
window.
11. Press the Trace Off pushbutton.
12. Once Performance Trace is switched off, you can analyze the data
Using Runtime Analysis Tool (SE30)
1. You can open the Runtime Analysis tool as follows:
To start from Choose
Any screen System Utilities Runtime Analysis Execute
Initial screen of ABAP
Workbench
Test Runtime Analysis
Initial screen of ABAP Editor Program Execute Runtime Analysis
ABAP Editor Utilities More utilities Runtime Analysis
2. In the simplest case, you would enter a short description and a measurement object
(transaction, program, or function module) to run the analysis in the current session.
3. In the Measurement restrictions group box, you can make more specific restrictions for the
measurement. For example, you may want to include only certain statements or time periods.
(For further information refer section 3. 0).
4. To start the measurement, choose Measure runtime. From the initial screen, you can
specify whether the analysis should run in the same session or in a parallel session using the
Enable/Disable button in the In parallel session group box.
5. Run the transaction, program, or function module as normal.
6. Return to the initial screen of the Runtime Analysis transaction. To do so, either leave
transaction, program, or function module as normal, or start the runtime analysis again.
7. The name of the performance data file that has just been created is displayed at the bottom of
the initial screen. The file created by the system is added to the list of performance data files.
You can now analyze, print, or delete the file, or save it locally. The Performance file group
box contains options for analyzing performance files. (For further information refer sections 4.
0 and 5. 0)
regards,
keerthi -
Dear Experts,
I am urgently looking forward to some comprehensive documentation on Performance tunning elaborating on the issues like:-
1.)In what instances should we do performance tunning....
2.) why it is neccessary and
3.) what r the <b><u>various methods</b> <b>of performance tunnig....</u></b>
I shall be highly obliged, if anyone can point me to relevant links, or send me illustrative documentation on these issues in performance tunning at [email protected]
ur help shall be thankfully/duely acknowledged,
regards,
shalini.
Message was edited by: shalini guptaShalini ,
Performance tuning is at various levels :
1. Data Modeling
2. Data Loading
3. Report design
4. Reporting
It is a mix and match of the above and other factors you might need to consider could also be something like:
1. DB being used
2. Partitioning
3. System parameters
4. Authorization Design...
All this depends on the level of performance tuning you want to do:
https://websmp204.sap-ag.de/~sapidb/011000358700001890502003
This is a link to the support portal and I have sent the same across to you. Hope it is useful.
Arun -
How to improve my pls/sql performance tunning skills
Hi All , I would like to learn more about pl/sql performance tunning , where or how can i get more knowledge in this area ?
Is there any tutorials which can help me to understand the Explain plan, Dbms_Profiler, Dbms_Advisor more etc ........Thanks . BcjExplain plan
http://www.psoug.org/reference/explain_plan.html
DBMS_PROFILER (10g)
http://www.psoug.org/reference/dbms_profiler.html
DBMS_HPROF (11g)
http://www.psoug.org/reference/dbms_hprof.html
DBMS_ADVISOR
http://www.psoug.org/reference/dbms_advisor.html
DBMS_MONITOR
http://www.psoug.org/reference/dbms_monitor.html
DBMS_SUPPORT
http://www.psoug.org/reference/dbms_support.html
DBMS_TRACE
http://www.psoug.org/reference/dbms_trace.html
DBMS_SQLTUNE
http://www.psoug.org/reference/dbms_sqltune.html -
Oracle apps performance tunning
Hey
could u any one tell me where i will get the Oracle Apps Performance
Tunning on Module wise like OM/AP/AR.
how to verify that my oracle Apps[11.5.10] instance running fine on linux based !!
i need check list Oracle Apps Performance !!best would be to start with http://docs.oracle.com/cd/E11882_01/server.112/e16638/toc.htm
Regards
Karan -
Oracle 11g Performance tunning
Hi Guru's
I am new to Performance tunning, can u please guide me from where to start performance tuning so that i study and do the practical as well.
I know how to run AWR and ADDM but i want to konw what are the sequence i follow to learn and do performance tunning.
Thanks in advancebest would be to start with http://docs.oracle.com/cd/E11882_01/server.112/e16638/toc.htm
Regards
Karan -
How to do Performance tunning in OBIEE
Hi All,
We are using OBIEE 10.3.4 version on windows envorinment .In our OBIEE project we are using 9 reports my requriment is we need to do performance tunning for OBIEE side.For eace report accessing its taking around 80 sec.We need to decrease these accessing time,is there any possibility to access all the reports with less response time in OBIEE side.
Could you anyone suggest how to do performance tunning in OBIEE side.
Thanks,
Vijay.Vijay,
Plz refer
http://www.business-intelligence-quotient.com/?p=119
http://prolynxuk.com/blog/?p=173
http://businessdecisionsystems.com/blog/?p=486
Here is the section from the BIEE admin guide:
=======================
Usage Examples
This section provides a few examples of how to use Oracle hints in conjunction with the Oracle BI Server. For more information about Oracle hints, refer to the Oracle SQL Reference documentation for the version of the Oracle server that you use.
Index Hint
The Index hint instructs the optimizer to scan a specified index rather than a table. The following hypothetical example explains how you would use the Index hint. You find queries against the ORDER_ITEMS table to be slow. You review the query optimizer's execution plan and find the FAST_INDEX index is not being used. You create an Index hint to force the optimizer to scan the FAST_INDEX index rather than the ORDER_ITEMS table. The syntax for the Index hint is index(table_name, index_name). To add this hint to the repository, navigate to the Administration Tool's Physical Table dialog box and type the following text in the Hint field:
index(ORDER_ITEMS, FAST_INDEX)
Leading Hint
The Leading hint forces the optimizer to build the join order of a query with a specified table. The syntax for the Leading hint is leading(table_name). If you were creating a foreign key join between the Products table and the Sales Fact table and wanted to force the optimizer to begin the join with the Products table, you would navigate to the Administration Tool's Physical Foreign Key dialog box and type the following text in the Hint field:
leading(Products)
So, the table names "order_items" and "products" in the above documentation will not be the same after BIEE puts aliases on them.
============
Hope this is useful..
Edited by: Deepak Gupta on Aug 1, 2011 7:18 AM -
Dear Experts,
I am executing a query which is build on a Multiprovider. The execution time is approx. 12 mins, again if I enable a dimension to analyze it takes another 15 mins.
The technical details of the query are:
1) The multiprovider fetches data from three different Cubes.
2) It contains three diff characteristics out of which one is having a 10 level hierarchy and one is having a 2 level hierarchy. Both the hierarchies are externally maintained.
3) It contains KPIs which calculate the sales on diff time lines such as CM MTD, LM MTD, CY YTD, LY YTD with the help of a customer exit.
4) It converts the quatities in alt unit of measures through an exit.
Kindly suggest for performance tunning. How shall i achieve min query execution time??
-KushalHI Kushal,
effective query on MP can be found
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b03b7f4c-c270-2910-a8b8-91e0f6d77096
for nw2004s
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a9ab011a-0e01-0010-02a1-d496b94c9c0f
modeling on multiprovider
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2f5aa43f-0c01-0010-a990-9641d3d4eef7
docs on performance available in
FAQ - The Future of SAP NetWeaver Business Intelligence in the Light of the NetWeaver BI&Business Objects Roadmap
https://service.sap.com/bi
-> performance
Also,
check the parallel processing setting, your query is non cumulative ...
629541 Multiprovider: Parallel Processing
911939 Optimization hint for logical MultiProvider partitioning
907881 MultiProvider with (too) many part providers
Performance of non-cumulative queries in MultiProviders
903559 MultiProvider optimization is only partially active
942554 Perf when working with BI inp help with multiprov on Oracle
607164 MultiProvider: Sequential processing is faster than parallel
913975 Performance problems for MultiProviders with many partprov.
hope this helps
Best Regards,
VVenkat.. -
Hi,
Can any one help me how to do performance tunning.I was given two scripts which contains more UNION clauses.Hi,
What version of Oracle are you on? If you have Oracle 22S (the S is for "Sentient"), there's one way:
SCOTT@ORA22S> set autotrace traceonly explain
SCOTT@ORA22S> ed
Wrote file afiedt.buf
1 select *
2 from test
3* where test_date > date '2001-01-01'
SCOTT@ORA22S> /
Execution Plan
0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=40656 Card=1071132 Bytes=163883196)
1 0 TABLE ACCESS (BY INDEX ROWID) OF 'TEST' (TABLE) (Cost=40656 Card=1071132 Bytes=163883196)
2 1 INDEX (FULL SCAN) OF 'TST_CUSTOM_03' (INDEX) (Cost=6785 Card=1071132)
SCOTT@ORA22S> alter session set sql_go_fast = true;
Session altered.
SCOTT@ORA22S> /
Execution Plan
0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=9979 Card=1071132 Bytes=163883196)
1 0 TABLE ACCESS (FULL) OF 'TEST' (TABLE) (Cost=9979 Card=1071132 Bytes=163883196)Unfortunately Oracle 22S may not be available for a while. Until then you may have to listen to Billy ;-)
cheers,
Anthony -
Performance Tune Stored procedures
Hi Experts,
What is the best approach to performance tune stored procedures. Is it to run expalin plan for the queries used in cursors or there is more to it?
I need all your advise.
ThanksAs generic advice: Absolutely not.
The performance of PL/SQL may be irrelevant to the performance of specific SQL statements contained.
Consider the following:
1. A very inefficient query that runs one time and takes 2 seconds to execute.
2. A query that runs in 2 milliseconds inside a loop.
Which one is more likely to be the issue?
The answer is that it depends on the number of interations of the loop.
The proper tool for tuning PL/SQL, as discussed by Tom Kyte, are, depending on version, DBMS_PROFILER or DBMS_HPROF.
Find out where the time is being spent.
Then tune that which takes the most time.
It is not necessarily the slowest SQL statement. -
SCM Live cache performance tunning
I got a ne project here I have to work on SCM live cache, performance tunning and ECC Integrating ith SCM.
If you have any documents can you please help me.
- Thanks7,
Try these
https://websmp103.sap-ag.de/~sapidb/011000358700000567062006E
https://websmp103.sap-ag.de/~sapidb/011000358700002213412003E
https://websmp103.sap-ag.de/~sapidb/011000358700000715082008E
https://websmp103.sap-ag.de/~sapidb/011000358700007382642002E
https://websmp103.sap-ag.de/~sapidb/011000358700008748092002E
Rgds,
DB49
Maybe you are looking for
-
How to convert Oracle Report into Excel
Hi, Please guide for the following: I am using, Report Developer 11g and I want to save Oracle report into Excel format, is it possible ? Regards, Thanks.
-
Insert a page from the current document into another
I am trying to insert the current page of the current document into a new document I am building in variable doc. So I can do something like doc.insertPages({nPage: i, ... ,nStart: 0}); How do I make the source be the current document? Should I use c
-
What is Application Default Currency used for?
Hi, Can anybody tell me what is the use of Application Default Currency when it is mandatory to assign every entity a currency?
-
Can't copy and paste to InDesign
Like title says... I can't copy from Mac Pages to Indesign CC on my new Macbook Pro Retina. I have to use TextEdit instead. Any help would be much appreciated. Logan
-
How can I tell whther my iPhone4 is a CDMA or a GSM device? Thanks.
How can I tell whther my iPhone4 is a CDMA or a GSM device?