Help required in tunning
Hi All
When i run my query with below conditions my query runs fast(350-400 ms)
WHERE LOC.NUM_LOCATION_TYPE = 4
AND LOC.NUM_LOCATION=LS.NUM_DEST_LOCATION
AND NVL(LS.NUM_DEST_LOCATION,9999) > DECODE(-1,-1,1,0,0,-1-1)
AND NVL(LS.NUM_DEST_LOCATION,9999) < DECODE(-1,-1,9999999,0,0,-1+1)
But if i remove the NVL, my query takes around 2sec and cost increases.
(LS.NUM_DEST_LOCATION is neither a primary key nor it indexed.)
Any idea please???
Regards,
Satya
Thanks rob really its a very usefull thread.
Please find explain plan and trace file below and suggest.
explain plan with NVL:
PLAN_TABLE_OUTPUT
| Id | Operation | Name | Rows
| Bytes | Cost |
| 0 | SELECT STATEMENT | | 8
PLAN_TABLE_OUTPUT
| 1296 | 234 |
| 1 | SORT GROUP BY | | 8
| 1296 | 234 |
| 2 | FILTER | |
| | |
| 3 | NESTED LOOPS OUTER | | 8
| 1296 | 232 |
PLAN_TABLE_OUTPUT
| 4 | NESTED LOOPS OUTER | | 8
| 1160 | 200 |
| 5 | HASH JOIN OUTER | | 8
| 1088 | 192 |
| 6 | NESTED LOOPS OUTER | | 8
| 984 | 189 |
| 7 | NESTED LOOPS | | 8
| 736 | 181 |
PLAN_TABLE_OUTPUT
| 8 | NESTED LOOPS | | 8
| 672 | 173 |
| 9 | NESTED LOOPS | | 8
| 536 | 157 |
| 10 | HASH JOIN | | 8
| 248 | 141 |
| 11 | TABLE ACCESS BY INDEX ROWID| LOCATION | 10
PLAN_TABLE_OUTPUT
| 90 | 2 |
| 12 | INDEX RANGE SCAN | IE02_LOCATION | 10
| | 1 |
| 13 | TABLE ACCESS FULL | LOAD_SHIP | 11
| 242 | 138 |
| 14 | TABLE ACCESS BY INDEX ROWID | SPECIAL_CONTAINER | 1
| 36 | 2 |
PLAN_TABLE_OUTPUT
| 15 | INDEX RANGE SCAN | IE01_SPECIAL_CONTAINER | 5
| | 1 |
| 16 | TABLE ACCESS BY INDEX ROWID | LOAD_SHIP_STATUS | 1
| 17 | 2 |
| 17 | INDEX UNIQUE SCAN | PK00_LOAD_SHIP_STATUS | 113
| | 1 |
| 18 | TABLE ACCESS BY INDEX ROWID | LOCATION | 1
| 8 | 1 |
PLAN_TABLE_OUTPUT
| 19 | INDEX UNIQUE SCAN | PK00_LOCATION | 1
| | |
| 20 | TABLE ACCESS BY INDEX ROWID | STEMMERY_BLEND | 1
| 31 | 1 |
| 21 | INDEX UNIQUE SCAN | PK_STEMMERY_BLEND | 1
| | |
| 22 | TABLE ACCESS FULL | PACKING_MARK | 169
PLAN_TABLE_OUTPUT
| 2197 | 2 |
| 23 | TABLE ACCESS BY INDEX ROWID | BLEND_MARK | 1
| 9 | 1 |
| 24 | INDEX UNIQUE SCAN | PK_BLEND_MARK | 1
| | |
| 25 | VIEW PUSHED PREDICATE | | 1
| 17 | |
PLAN_TABLE_OUTPUT
| 26 | INLIST ITERATOR | |
| | |
| 27 | TABLE ACCESS BY INDEX ROWID | LOAD_SHIP_STATUS | 1
| 17 | 4 |
| 28 | INDEX RANGE SCAN | PK00_LOAD_SHIP_STATUS | 1
| | 3 |
----------------- Trace file with NVL
Misses in library cache during parse: 0
Optimizer goal: CHOOSE
Parsing user id: 53
SELECT LS.CDE_CROP_SEASON,
LS.NUM_TOBACCO_TYPE,
LOC1.NUM_LOCATION,
LOC1.NME_LOCATION,
SC.CDE_COUPON_ID,
SC.QTY_SHIP_WEIGHT PURCHASED_WEIGHT,
SC.DTE_UPDATED PURCHASE_DATE,
SC.QTY_SHIP_WEIGHT,
SC.NUM_LOAD_SHIP,
MAX(DECODE(LSS1.NUM_STATUS_TYPE,12,LSS1.DTE_UPDATED,16,LSS1.DTE_UPDATED,NULL)) SHIP_DATE,
MAX(DECODE(LSS1.NUM_STATUS_TYPE,9,LSS1.DTE_UPDATED,NULL)) RECEIPT_DATE,
SC.QTY_STEM_WEIGHT,
PM.CDE_PACKING_MARK,
BM.CDE_BLEND_MARK,
SB.QTY_GREEN_WEIGHT,
SB.DTE_BLEND
FROM LYC.LOCATION LOC,
LYC.LOAD_SHIP LS,
LYC.LOAD_SHIP_STATUS LSS,
LYC.SPECIAL_CONTAINER SC,
LYC.LOCATION LOC1,
(SELECT NUM_LOAD_SHIP,
NUM_STATUS_TYPE,
DTE_UPDATED
FROM LYC.LOAD_SHIP_STATUS
WHERE NUM_STATUS_TYPE IN (9,12,16)) LSS1,
LYC.stemmery_BLEND SB,
LYC.BLEND_MARK BM,
LYC.PACKING_MARK PM
WHERE LOC.NUM_LOCATION_TYPE = 4
AND LOC.NUM_LOCATION=LS.NUM_DEST_LOCATION
AND NVL(LS.NUM_DEST_LOCATION,9999) > DECODE(-1,-1,1,0,0,-1-1)
AND NVL(LS.NUM_DEST_LOCATION,9999) < DECODE(-1,-1,9999999999,0,0,-1+1)
AND LS.NUM_ORIGIN_LOCATION > DECODE(-1,-1,1,0,0,-1-1)
AND LS.NUM_ORIGIN_LOCATION < DECODE(-1,-1,9999999999,0,0,-1+1)
AND LS.CDE_CROP_SEASON = 2006
AND LS.NUM_TOBACCO_TYPE = 2
AND LS.NUM_LOAD_SHIP = LSS.NUM_LOAD_SHIP
AND LSS.NUM_STATUS_TYPE =6
AND LSS.DTE_UPDATED>=sysdate-500
AND LSS.DTE_UPDATED<=sysdate
and LS.NUM_LOAD_SHIP =SC.NUM_LOAD_SHIP
AND SC.IND_FLOOR_SCRAP = -1
AND LS.NUM_ORIGIN_LOCATION=LOC1.NUM_LOCATION
and ls.num_load_ship=lss1.num_load_ship(+)
--// Filters
AND SC.CDE_COUPON_ID=SB.CDE_COUPON_ID(+)
AND SB.NUM_BLEND_MARK=BM.NUM_BLEND_MARK(+)
AND SB.NUM_PACKING_MARK=PM.NUM_PACKING_MARK(+)
GROUP BY LS.CDE_CROP_SEASON,
LS.NUM_TOBACCO_TYPE,
LOC1.NUM_LOCATION,
LOC1.NME_LOCATION,
SC.CDE_COUPON_ID,
SC.QTY_SHIP_WEIGHT,
SC.DTE_UPDATED,
SC.QTY_SHIP_WEIGHT,
SC.NUM_LOAD_SHIP,
SC.QTY_STEM_WEIGHT,
PM.CDE_PACKING_MARK,
BM.CDE_BLEND_MARK,
SB.QTY_GREEN_WEIGHT,
SB.DTE_BLEND
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 3 0.18 0.34 1416 6177 0 18
total 5 0.18 0.34 1416 6177 0 18
Misses in library cache during parse: 0
Optimizer goal: CHOOSE
Parsing user id: 53
Rows Row Source Operation
18 SORT GROUP BY
36 FILTER
36 NESTED LOOPS OUTER
18 NESTED LOOPS OUTER
18 HASH JOIN OUTER
18 NESTED LOOPS OUTER
18 NESTED LOOPS
18 NESTED LOOPS
18 NESTED LOOPS
4387 HASH JOIN
10 TABLE ACCESS BY INDEX ROWID OBJ#(34556)
10 INDEX RANGE SCAN OBJ#(34559) (object id 34559)
4387 TABLE ACCESS FULL OBJ#(34546)
18 TABLE ACCESS BY INDEX ROWID OBJ#(34712)
63 INDEX RANGE SCAN OBJ#(34714) (object id 34714)
18 TABLE ACCESS BY INDEX ROWID OBJ#(34551)
18 INDEX UNIQUE SCAN OBJ#(34552) (object id 34552)
18 TABLE ACCESS BY INDEX ROWID OBJ#(34556)
18 INDEX UNIQUE SCAN OBJ#(34557) (object id 34557)
1 TABLE ACCESS BY INDEX ROWID OBJ#(34727)
1 INDEX UNIQUE SCAN OBJ#(34728) (object id 34728)
169 TABLE ACCESS FULL OBJ#(34595)
1 TABLE ACCESS BY INDEX ROWID OBJ#(34295)
1 INDEX UNIQUE SCAN OBJ#(34296) (object id 34296)
36 VIEW PUSHED PREDICATE
36 INLIST ITERATOR
36 TABLE ACCESS BY INDEX ROWID OBJ#(34551)
36 INDEX RANGE SCAN OBJ#(34552) (object id 34552)
OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 2 0.00 0.00 0 0 0 0
Fetch 3 0.18 0.34 1416 6177 0 18
total 6 0.18 0.34 1416 6177 0 18
Misses in library cache during parse: 0
OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
call count cpu elapsed disk query current rows
Parse 0 0.00 0.00 0 0 0 0
Execute 0 0.00 0.00 0 0 0 0
Fetch 0 0.00 0.00 0 0 0 0
total 0 0.00 0.00 0 0 0 0
Misses in library cache during parse: 0
2 user SQL statements in session.
0 internal SQL statements in session.
2 SQL statements in session.
Explain plan with out nvl
PLAN_TABLE_OUTPUT
| Id | Operation | Name | Rows | B
ytes | Cost |
| 0 | SELECT STATEMENT | | 176 | 2
PLAN_TABLE_OUTPUT
8512 | 1813 |
| 1 | SORT GROUP BY | | 176 | 2
8512 | 1813 |
| 2 | FILTER | | |
| |
| 3 | NESTED LOOPS OUTER | | 176 | 2
8512 | 1806 |
PLAN_TABLE_OUTPUT
| 4 | HASH JOIN | | 176 | 2
5520 | 1102 |
| 5 | TABLE ACCESS BY INDEX ROWID | LOCATION | 10 |
90 | 2 |
| 6 | INDEX RANGE SCAN | IE02_LOCATION | 9134 |
| 1 |
| 7 | HASH JOIN | | 495 | 6
7320 | 1099 |
PLAN_TABLE_OUTPUT
| 8 | HASH JOIN OUTER | | 495 | 6
3360 | 911 |
| 9 | HASH JOIN OUTER | | 495 | 5
8905 | 906 |
| 10 | NESTED LOOPS OUTER | | 495 | 5
2470 | 903 |
| 11 | HASH JOIN | | 495 | 3
PLAN_TABLE_OUTPUT
7125 | 408 |
| 12 | TABLE ACCESS FULL | SPECIAL_CONTAINER | 801 | 2
8836 | 141 |
| 13 | HASH JOIN | | 2754 |
104K| 266 |
| 14 | TABLE ACCESS FULL | LOAD_SHIP_STATUS | 2754 | 4
6818 | 126 |
PLAN_TABLE_OUTPUT
| 15 | TABLE ACCESS FULL | LOAD_SHIP | 4445 | 9
7790 | 138 |
| 16 | TABLE ACCESS BY INDEX ROWID| STEMMERY_BLEND | 1 |
31 | 1 |
| 17 | INDEX UNIQUE SCAN | PK_STEMMERY_BLEND | 1 |
| |
| 18 | TABLE ACCESS FULL | PACKING_MARK | 169 |
2197 | 2 |
PLAN_TABLE_OUTPUT
| 19 | TABLE ACCESS FULL | BLEND_MARK | 1599 | 1
4391 | 3 |
| 20 | TABLE ACCESS FULL | LOCATION | 91343 |
713K| 180 |
| 21 | VIEW PUSHED PREDICATE | | 1 |
17 | |
| 22 | INLIST ITERATOR | | |
PLAN_TABLE_OUTPUT
| |
| 23 | TABLE ACCESS BY INDEX ROWID | LOAD_SHIP_STATUS | 1 |
17 | 4 |
| 24 | INDEX RANGE SCAN | PK00_LOAD_SHIP_STATUS | 1 |
| 3 |
PLAN_TABLE_OUTPUT
Trace file with out NVL
alter session set sql_trace true
call count cpu elapsed disk query current rows
Parse 0 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 0 0.00 0.00 0 0 0 0
total 1 0.00 0.00 0 0 0 0
Misses in library cache during parse: 0
Optimizer goal: CHOOSE
Parsing user id: 53
SELECT LS.CDE_CROP_SEASON,
LS.NUM_TOBACCO_TYPE,
LOC1.NUM_LOCATION,
LOC1.NME_LOCATION,
SC.CDE_COUPON_ID,
SC.QTY_SHIP_WEIGHT PURCHASED_WEIGHT,
SC.DTE_UPDATED PURCHASE_DATE,
SC.QTY_SHIP_WEIGHT,
SC.NUM_LOAD_SHIP,
MAX(DECODE(LSS1.NUM_STATUS_TYPE,12,LSS1.DTE_UPDATED,16,LSS1.DTE_UPDATED,NULL)) SHIP_DATE,
MAX(DECODE(LSS1.NUM_STATUS_TYPE,9,LSS1.DTE_UPDATED,NULL)) RECEIPT_DATE,
SC.QTY_STEM_WEIGHT,
PM.CDE_PACKING_MARK,
BM.CDE_BLEND_MARK,
SB.QTY_GREEN_WEIGHT,
SB.DTE_BLEND
FROM LYC.LOCATION LOC,
LYC.LOAD_SHIP LS,
LYC.LOAD_SHIP_STATUS LSS,
LYC.SPECIAL_CONTAINER SC,
LYC.LOCATION LOC1,
(SELECT NUM_LOAD_SHIP,
NUM_STATUS_TYPE,
DTE_UPDATED
FROM LYC.LOAD_SHIP_STATUS
WHERE NUM_STATUS_TYPE IN (9,12,16)) LSS1,
LYC.stemmery_BLEND SB,
LYC.BLEND_MARK BM,
LYC.PACKING_MARK PM
WHERE LOC.NUM_LOCATION_TYPE = 4
AND LOC.NUM_LOCATION=LS.NUM_DEST_LOCATION
AND LS.NUM_DEST_LOCATION > DECODE(-1,-1,1,0,0,-1-1)
AND LS.NUM_DEST_LOCATION < DECODE(-1,-1,9999999999,0,0,-1+1)
AND LS.NUM_ORIGIN_LOCATION > DECODE(-1,-1,1,0,0,-1-1)
AND LS.NUM_ORIGIN_LOCATION < DECODE(-1,-1,9999999999,0,0,-1+1)
AND LS.CDE_CROP_SEASON = 2006
AND LS.NUM_TOBACCO_TYPE = 2
AND LS.NUM_LOAD_SHIP = LSS.NUM_LOAD_SHIP
AND LSS.NUM_STATUS_TYPE =6
AND LSS.DTE_UPDATED>=sysdate-500
AND LSS.DTE_UPDATED<=sysdate
and LS.NUM_LOAD_SHIP =SC.NUM_LOAD_SHIP
AND SC.IND_FLOOR_SCRAP = -1
AND LS.NUM_ORIGIN_LOCATION=LOC1.NUM_LOCATION
and ls.num_load_ship=lss1.num_load_ship(+)
--// Filters
AND SC.CDE_COUPON_ID=SB.CDE_COUPON_ID(+)
AND SB.NUM_BLEND_MARK=BM.NUM_BLEND_MARK(+)
AND SB.NUM_PACKING_MARK=PM.NUM_PACKING_MARK(+)
GROUP BY LS.CDE_CROP_SEASON,
LS.NUM_TOBACCO_TYPE,
LOC1.NUM_LOCATION,
LOC1.NME_LOCATION,
SC.CDE_COUPON_ID,
SC.QTY_SHIP_WEIGHT,
SC.DTE_UPDATED,
SC.QTY_SHIP_WEIGHT,
SC.NUM_LOAD_SHIP,
SC.QTY_STEM_WEIGHT,
PM.CDE_PACKING_MARK,
BM.CDE_BLEND_MARK,
SB.QTY_GREEN_WEIGHT,
SB.DTE_BLEND
call count cpu elapsed disk query current rows
Parse 1 1.06 1.07 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 3 0.51 1.31 5846 6269 0 18
total 5 1.57 2.39 5846 6269 0 18
Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 53
Rows Row Source Operation
18 SORT GROUP BY
36 FILTER
36 NESTED LOOPS OUTER
18 HASH JOIN
10 TABLE ACCESS BY INDEX ROWID OBJ#(34556)
10 INDEX RANGE SCAN OBJ#(34559) (object id 34559)
18 HASH JOIN
18 HASH JOIN OUTER
18 HASH JOIN OUTER
18 NESTED LOOPS OUTER
18 HASH JOIN
801 TABLE ACCESS FULL OBJ#(34712)
4378 HASH JOIN
8025 TABLE ACCESS FULL OBJ#(34551)
4387 TABLE ACCESS FULL OBJ#(34546)
1 TABLE ACCESS BY INDEX ROWID OBJ#(34727)
1 INDEX UNIQUE SCAN OBJ#(34728) (object id 34728)
169 TABLE ACCESS FULL OBJ#(34595)
1599 TABLE ACCESS FULL OBJ#(34295)
91353 TABLE ACCESS FULL OBJ#(34556)
36 VIEW PUSHED PREDICATE
36 INLIST ITERATOR
36 TABLE ACCESS BY INDEX ROWID OBJ#(34551)
36 INDEX RANGE SCAN OBJ#(34552) (object id 34552)
OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
call count cpu elapsed disk query current rows
Parse 1 1.06 1.07 0 0 0 0
Execute 2 0.00 0.00 0 0 0 0
Fetch 3 0.51 1.31 5846 6269 0 18
total 6 1.57 2.39 5846 6269 0 18
Misses in library cache during parse: 1
OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
call count cpu elapsed disk query current rows
Parse 0 0.00 0.00 0 0 0 0
Execute 0 0.00 0.00 0 0 0 0
Fetch 0 0.00 0.00 0 0 0 0
total 0 0.00 0.00 0 0 0 0
Misses in library cache during parse: 0
2 user SQL statements in session.
0 internal SQL statements in session.
2 SQL statements in session. Please suggest.
Message was edited by:
user451372
Similar Messages
-
Urgent Help required in Tunning this query
I have table ACCOUNT SPONSOR HOMESTORE ASH with more than 30 million rows.
My batch daily need to update or insert into this table from a temporary table TEMP_HSTRALCT. The data for temporary table is populated by below query which selects from two tables TRANSACTION POINTS and REDEMPTIONS.However both these tables are partitioned on date time and is run daily and this is running for hours.
Can anyone please help me on tuning this query
INSERT INTO temp_hstralct
(tmp_n_collector_account_num, tmp_v_location_id,
tmp_v_sponsor_id, tmp_v_source_file_name,
tmp_n_psc_insert_ind, tmp_n_psc_update_ind,
tmp_n_transaction_amount, tmp_n_transaction_points,
tmp_n_acc_insert_ind, tmp_n_ash_insert_ind,
tmp_n_col_insert_ind, tmp_n_check_digit,
tmp_n_collector_issue_num, tmp_n_csl_insert_ind,
tmp_v_offer_code, tmp_n_psa_insert_ind)
SELECT DISTINCT trp_n_collector_account_num account_num,
trp_v_location_id location_id,
trp_v_sponsor_id sponsor_id,
trp_c_creation_user batch_id, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0
FROM transaction_points, ACCOUNT, locations_master,homestores
WHERE hsr_v_accrual_allowed = 'Y'
AND trp_n_collector_account_num = ACCOUNT.acc_n_account_num(+)
AND ( ( ( ACCOUNT.acc_v_account_type = 'C'
OR ACCOUNT.acc_v_account_type IS NULL
AND hsr_v_b2c_accounts = 'Y'
OR ( ACCOUNT.acc_v_account_type = 'B'
AND hsr_v_nfb_accounts = 'Y'
OR ( ACCOUNT.acc_v_account_type = 'H'
AND hsr_v_hybrid_accounts = 'Y'
AND trp_d_creation_date_time BETWEEN SYSDATE-3
AND SYSDATE
AND trp_v_sponsor_id = 'JSAINSBURY'
AND trp_v_location_id =
locations_master.lnm_v_location_id
AND locations_master.lnm_v_partner_id = 'JSAINSBURY'
AND ( ( ( (INSTR
(hsr_v_store_status,
locations_master.lnm_c_location_status
) > 0
AND (INSTR
(hsr_v_store_type,
locations_master.lnm_c_location_type
) > 0
AND hsr_v_homestore_assignment = 'ST'
OR ( ( locations_master.lnm_c_homestore_ind =
'Y'
AND (INSTR
(hsr_v_store_status,
locations_master.lnm_c_location_status
) > 0
AND hsr_v_homestore_assignment = 'HS'
UNION ALL
SELECT DISTINCT rdm_n_collector_account_num account_num,
rdm_v_location_id location_id,
rom_v_supplier_id sponsor_id,
rdm_c_creation_user batch_id, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0
FROM redemption_details,
reward_offer_master,
ACCOUNT,
locations_master,
HOMESTORES
WHERE hsr_v_redemption_allowed = 'Y'
AND rdm_n_collector_account_num = ACCOUNT.acc_n_account_num(+)
AND ( ( ( ACCOUNT.acc_v_account_type = 'C'
OR ACCOUNT.acc_v_account_type IS NULL
AND hsr_v_b2c_accounts = 'Y'
OR ( ACCOUNT.acc_v_account_type = 'B'
AND hsr_v_nfb_accounts = 'Y'
OR ( ACCOUNT.acc_v_account_type = 'H'
AND hsr_v_hybrid_accounts = 'Y'
AND rdm_d_creation_date_time BETWEEN SYSDATE-3
AND SYSDATE
AND rom_v_reward_offer_id = rdm_v_reward_id
AND rom_v_supplier_id = 'JSAINSBURY'
AND rdm_v_location_id =
locations_master.lnm_v_location_id
AND locations_master.lnm_v_partner_id ='JSAINSBURY'
AND ( ( ( (INSTR
(hsr_v_store_status,
locations_master.lnm_c_location_status
) > 0
AND (INSTR
(hsr_v_store_type,
locations_master.lnm_c_location_type
) > 0
AND hsr_v_homestore_assignment = 'ST'
OR ( ( locations_master.lnm_c_homestore_ind =
'Y'
AND (INSTR
(hsr_v_store_status,
locations_master.lnm_c_location_status
) > 0
AND hsr_v_homestore_assignment = 'HS'
);I have copied the explain as it is and can you please try pasting in the text pad.Can you let me know whether parallel hint on this will speed up the select queries.
Plan
INSERT STATEMENT CHOOSECost: 410,815 Bytes: 2,798,394 Cardinality: 15,395
32 UNION-ALL
15 SORT UNIQUE Cost: 177,626 Bytes: 2,105,592 Cardinality: 11,896
14 FILTER
13 HASH JOIN Cost: 177,312 Bytes: 2,105,592 Cardinality: 11,896
2 TABLE ACCESS BY INDEX ROWID LMHOLTP.LOCATIONS_MASTER Cost: 37 Bytes: 23,184 Cardinality: 966
1 INDEX RANGE SCAN NON-UNIQUE LMHOLTP.IX_LOCATIONS_MASTER_3 Cost: 3 Cardinality: 1
12 FILTER
11 HASH JOIN OUTER
8 MERGE JOIN CARTESIAN Cost: 155,948 Bytes: 702,656,660 Cardinality: 4,845,908
3 TABLE ACCESS FULL LMHOLTP.HOMESTORES Cost: 2 Bytes: 104 Cardinality: 1
7 BUFFER SORT Cost: 155,946 Bytes: 198,682,228 Cardinality: 4,845,908
6 PARTITION RANGE ITERATOR Partition #: 12
5 TABLE ACCESS BY LOCAL INDEX ROWID LMHOLTP.TRANSACTION_POINTS Cost: 155,946 Bytes: 198,682,228 Cardinality: 4,845,908 Partition #: 12
4 INDEX RANGE SCAN NON-UNIQUE LMHOLTP.IX_TRANSACTION_POINTS_1 Cost: 24,880 Cardinality: 6,978,108 Partition #: 12
10 PARTITION RANGE ALL Partition #: 15 Partitions accessed #1 - #5
9 TABLE ACCESS FULL LMHOLTP.ACCOUNT Cost: 6,928 Bytes: 68,495,680 Cardinality: 8,561,960 Partition #: 15 Partitions accessed #1 - #5
31 SORT UNIQUE Cost: 233,189 Bytes: 692,802 Cardinality: 3,499
30 FILTER
29 FILTER
28 NESTED LOOPS OUTER
24 HASH JOIN Cost: 226,088 Bytes: 664,810 Cardinality: 3,499
16 TABLE ACCESS FULL LMHOLTP.REWARD_OFFER_MASTER Cost: 8 Bytes: 2,280 Cardinality: 114
23 HASH JOIN Cost: 226,079 Bytes: 8,327,280 Cardinality: 48,984
20 TABLE ACCESS BY INDEX ROWID LMHOLTP.LOCATIONS_MASTER Cost: 37 Bytes: 432 Cardinality: 18
19 NESTED LOOPS Cost: 39 Bytes: 2,304 Cardinality: 18
17 TABLE ACCESS FULL LMHOLTP.HOMESTORES Cost: 2 Bytes: 104 Cardinality: 1
18 INDEX RANGE SCAN NON-UNIQUE LMHOLTP.IX_LOCATIONS_MASTER_3 Cost: 3 Cardinality: 966
22 PARTITION RANGE ITERATOR Partition #: 28
21 TABLE ACCESS FULL LMHOLTP.REDEMPTION_DETAILS Cost: 226,019 Bytes: 261,636,270 Cardinality: 6,229,435 Partition #: 28
27 PARTITION RANGE ITERATOR Partition #: 30
26 TABLE ACCESS BY LOCAL INDEX ROWID LMHOLTP.ACCOUNT Cost: 2 Bytes: 8 Cardinality: 1 Partition #: 30
25 INDEX UNIQUE SCAN UNIQUE LMHOLTP.CO_PK_ACCOUNT Cost: 1 Cardinality: 1 Partition #: 30 -
Help required regarding tunning the query mentioned
HI all ,
Query mentioned below takes around 1 hr to complete . It's being used by the autoconfig kindly me in tunning it ..
QUery :
UPDATE WF_ITEM_ATTRIBUTE_VALUES WIAV SET WIAV.TEXT_VALUE = REPLACE(WIAV.TEXT_VALUE,:B1,:B2)
WHERE (WIAV.ITEM_TYPE, WIAV.NAME) = (SELECT WIA.ITEM_TYPE, WIA.NAME
FROM WF_ITEM_ATTRIBUTES WIA WHERE WIA.TYPE = 'URL'
AND WIA.ITEM_TYPE = WIAV.ITEM_TYPE
AND WIA.NAME = WIAV.NAME)
AND WIAV.TEXT_VALUE IS NOT NULL
AND INSTR(WIAV.TEXT_VALUE
, :B1) > 0
Plan :*
<pre>
| Id | Operation | Name | Rows | Bytes | Cost |
| 0 | UPDATE STATEMENT | | 453 | 14496 | 284K|
| 1 | UPDATE | WF_ITEM_ATTRIBUTE_VALUES | | | |
|* 2 | FILTER | | | | |
|* 3 | TABLE ACCESS FULL | WF_ITEM_ATTRIBUTE_VALUES | 453 | 14496 | 282K|
|* 4 | TABLE ACCESS BY INDEX ROWID| WF_ITEM_ATTRIBUTES | 1 | 33 | 2 |
|* 5 | INDEX UNIQUE SCAN | WF_ITEM_ATTRIBUTES_PK | 1 | | 1 |
Predicate Information (identified by operation id):
2 - filter(("SYS_ALIAS_2"."ITEM_TYPE","SYS_ALIAS_2"."NAME")= (SELECT /*+ */
"WIA"."ITEM_TYPE","WIA"."NAME" FROM "APPLSYS"."WF_ITEM_ATTRIBUTES" "WIA" WHERE
"WIA"."NAME"=:B1 AND "WIA"."ITEM_TYPE"=:B2 AND "WIA"."TYPE"='URL'))
3 - filter("SYS_ALIAS_2"."TEXT_VALUE" IS NOT NULL AND
INSTR("SYS_ALIAS_2"."TEXT_VALUE",:Z)>0)
4 - filter("WIA"."TYPE"='URL')
5 - access("WIA"."ITEM_TYPE"=:B1 AND "WIA"."NAME"=:B2)
</pre>
Index :*
<pre>
INDEX_NAME COLUMN_NAME
APPLSYS WF_ITEM_ATTRIBUTE_VALUES_PK 1 ITEM_TYPE
2 ITEM_KEY
3 NAME
</pre>
regds
Rahul
Edited by: RahulG on Jan 2, 2009 10:47 PM
Edited by: RahulG on Jan 2, 2009 10:48 PMRahulG wrote:
HI all ,
Query mentioned below takes around 1 hr to complete . It's being used by the autoconfig kindly me in tunning it ..
A few notes:
1. Your query is using bind variables. If you're already on 9i or later (probably 9iR2 according to plan output), this statement will be subject to bind variable peeking and therefore the output of EXPLAIN PLAN is only of limited use, since the actual execution plan might be different and/or might be based on different cardinality estimates based on the actual bind values peeked at hard parse time. You can use the V$SQL_PLAN view to get the actual execution plan(s) if the statement is still cached in the shared pool, from 10g on DBMS_XPLAN.DISPLAY_CURSOR is available for that purpose.
2. The execution plan posted suggests that only 453 rows will correspond to the filter criteria (but, as mentioned in 1. is based on an unknown bind variable value when using EXPLAIN PLAN), and probably therefore the optimizer didn't unnest the subquery but runs this as recursive FILTER query potentially for each row passing the filter criteria on the driving table WF_ITEM_ATTRIBUTE_VALUES. Depending on the actual number of rows this might be inefficient, and unnesting the subquery and turning it into a join might be more appropriate. This might accomplished e.g. by providing more representative statistics to the optimizer (are the statistics up-to-date?).
Although you can't change the SQL you could try this manually by using the UNNEST hint to see if it makes any difference in the execution plan (and run time):
WHERE (WIAV.ITEM_TYPE, WIAV.NAME) = (SELECT /*+ UNNEST */ WIA.ITEM_TYPE, WIA.NAME
...3. The composite index WF_ITEM_ATTRIBUTE_VALUES_PK can only be used on the first column ITEM_TYPE for effective index access, the NAME column would have to be used as filter on all index leaf blocks that would be found using a range scan on ITEM_TYPE. This might be quite inefficient, and/or might lead to a lot of rows/blocks that need to be visited in the table using this index access path.
4. You could try to trace the execution by enabling extended SQL trace, e.g. using the (undocumented) DBMS_SUPPORT package in 9i. Running the "tkprof" utility on the generated trace file tells you the actual row source cardinalities (which can then be compared to the estimates of the optimizer) and - if the "waits" have been enabled - what your statement has waited for most.
Regards,
Randolf
Oracle related stuff blog:
http://oracle-randolf.blogspot.com/
SQLTools++ for Oracle (Open source Oracle GUI for Windows):
http://www.sqltools-plusplus.org:7676/
http://sourceforge.net/projects/sqlt-pp/ -
i keep getting this message " a required i tunes component is not installed please repair or reinstall i tunes(-45075)" i get this every time i open the program and it prompts me to say ok and when i do it shuts the program down i went to the i tunes web site and re down loaded the program and still nothing i dont want to loose my music library
Hi mbelanger1,
If you are still having issues with that error message, you may need to entirely remove iTunes, then reinstall it. You may find the following article helpful:
Apple SupportL: Removing and reinstalling iTunes and other software components for Windows Vista, Windows 7, or Windows 8
http://support.apple.com/kb/ht1923
Note:
iTunes Store purchases or songs imported from CDs are saved in your My Music folder by default and aren't deleted by removing iTunes. While it's highly unlikely that you'll lose any contents of your iTunes Library when following these steps, it's always a good idea to ensure that your iTunes library is backed up. If you're unsure how to backup, follow these steps.
Regards,
- Brenden -
XSLT mapping Help Required.
XSLT mapping Help Required.
Hi Experts,
I am New to XSLT Mapping. I am practising the below Example:
InputXML File:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="Persons111.xsl"?>
<ns0:MT_XSLT_Source xmlns:ns0="http://XYZ.com/gen">
<Person>
<FirstName>Anshul</FirstName>
<LastName>Chowdhary</LastName>
<Gender>Male</Gender>
<Address>
<Street>2nd Main</Street>
<Houseno>83/b</Houseno>
<City>Mysore</City>
</Address> </Person>
</ns0:MT_XSLT_Source>
XSL StyleSheet File:
<?xml version='1.0' encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://XYZ.com/Gen"
Xmlns:ns1=”http://XYZ.com/Test”>
<xsl:template match="/">
<ns1:MT_XSLT_Target>
<Title> <xsl:value-of select="ns0:MT_XSLT_Source/Person/Gender"/> </Title>
<Name> <xsl:value-of select="concat(concat(ns0:MT_XSLT_Source/Person/FirstName,' '), ns0:MT_XSLT_Source/Person/LastName)"/>
</Name>
<Street> <xsl:value-of select="concat(concat(ns0:Mt_XSLT_Source/Person/Address/Houseno,' '),
ns0:Mt_XSLT_Source/Person/Address/Street)"/> </Street>
<City> <xsl:value-of select="ns0:Mt_XSLT_Source/Person/Address/City"/> </City>
</ns1:MT_XSLT_Target>
</xsl:template>
</xsl:stylesheet>
The Desired Output shuold be:
<?xml version="1.0" encoding="UTF-8"?>
<ns1:MT_XSLT_Target xmlns:ns1="http://XYZ.com/Test">
<Title>Male</Title>
<Name>Anshul Chowdhary</Name>
<Street>83/b 2nd Main</Street>
<City>Mysore</City>
</ns1:MT_XSLT_Target>
I have refered the xsl in xml and i am getting the below Oupt in a Single line like this:
Anshul Chowdhary Male 2nd Main 83/b Mysore
I am Unable to display in Target XML Fomrat as shown above. Please check and do the needful.
Regards,
GIRIDHARHi,
I have used below for testing.
Input xml:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="Persons111.xsl"?>
<ns0:MT_XSLT_Source xmlns:ns0="http://XYZ.com/gen">
<Person>
<FirstName>Anshul</FirstName>
<LastName>Chowdhary</LastName>
<Gender>Male</Gender>
<Address>
<Street>2nd Main</Street>
<Houseno>83/b</Houseno>
<City>Mysore</City>
</Address> </Person>
</ns0:MT_XSLT_Source>
xsl code:
<?xml version='1.0' encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://XYZ.com/gen"
xmlns:ns1="http://XYZ.com/Test">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<ns1:MT_XSLT_Target>
<Title> <xsl:value-of select="ns0:MT_XSLT_Source/Person/Gender"/> </Title>
<Name> <xsl:value-of select="concat(concat(ns0:MT_XSLT_Source/Person/FirstName,' '), ns0:MT_XSLT_Source/Person/LastName)"/>
</Name>
<Street> <xsl:value-of select="concat(concat(/ns0:MT_XSLT_Source/Person/Address/Houseno,' '),
/ns0:MT_XSLT_Source/Person/Address/Street)"/> </Street>
<City> <xsl:value-of select="/ns0:MT_XSLT_Source/Person/Address/City"/> </City>
</ns1:MT_XSLT_Target>
</xsl:template>
</xsl:stylesheet>
For testing in PI ,change the extension from .txt to .xsl and zip it and upload into PI as an imported archive .
Regards
Venkat -
Hi Guru's
Can you please help me query tunning.
Database Version : Oracle 11g - 11.2.0.3
select distinct corporation_name custer_name,
glog_util.remove_domain(SHIP_BUY.SERVPROV_GID ) SCAC,
glog_util.remove_domain(ship_buy.shipment_gid) buy_shipment_gid,
F_Get_SELL_ID_STRING(SHIP_BUY.SHIPMENT_GID) sell_shipment_gid,
ship_buy.domain_name,
F_GET_ORDER_RELEASE_GID('B',SHIP_BUY.SHIPMENT_GID,0) ORDER_RELEASE_GID,
f_get_refnum_string('SHIPMENT', ship_buy.shipment_gid, 'MBOL_NUMBER_CLEANSED')MBOL_NUMBER,
F_GET_POD_RECEIVED_DATE (ship_BUY.SHIPMENT_GID) POD_RECEIVED_DATE,
f_get_exp_accrue_amt(ship_buy.shipment_gid,'SHIPMENT') Total_accrual_amount
from shipment ship_buy,
invoice inv,
invoice_shipment si,
--voucher v,
corporation corp
where corp.domain_name=ship_buy.domain_name
and corp.is_domain_master='Y'
and 1=1
AND ship_buy.domain_name like 'UPS/CP/DFP/%'
and F_GET_POD_RECEIVED_DATE (ship_BUY.SHIPMENT_GID) <= to_char(to_date('31-JUL-2013', 'DD-MON-YYYY'), 'dd-mon-yyyy')
--and V.INVOICE_GID(+) = inv.invoice_gid
--and ship_buy.domain_name = 'UPS/CP/VZNB'
and si.shipment_gid(+) = SHIP_BUY.SHIPMENT_GID
AND SI.INVOICE_GID = INV.INVOICE_GID(+)
and SHIP_BUY.INSERT_DATE > '1-JAN-2007'
and SHIP_BUY.USER_DEFINED1_ICON_GID = 'ACCEPTED'
UNION
select distinct corporation_name custer_name,
glog_util.remove_domain(SHIP_BUY.SERVPROV_GID ) SCAC,
glog_util.remove_domain(ship_buy.shipment_gid) buy_shipment_gid,
F_GET_SELL_ID_STRING( SHIP_BUY.SHIPMENT_GID) sell_shipment_gid,
ship_buy.domain_name,
F_GET_ORDER_RELEASE_GID('B',SHIP_BUY.SHIPMENT_GID,0) ORDER_RELEASE_GID,
f_get_refnum_string('SHIPMENT', ship_buy.shipment_gid, 'MBOL_NUMBER_CLEANSED')MBOL_NUMBER,
F_GET_POD_RECEIVED_DATE (ship_BUY.SHIPMENT_GID) POD_RECEIVED_DATE,
f_get_exp_accrue_amt(inv.invoice_gid,'INVOICE') Total_accrual_amount
from shipment ship_buy,
invoice inv,
invoice_shipment si,
-- voucher v,
corporation corp
where corp.domain_name=ship_buy.domain_name
and corp.is_domain_master='Y'
and 1=1
AND ship_buy.domain_name like 'UPS/CP/DFP/%'
and F_GET_POD_RECEIVED_DATE (ship_BUY.SHIPMENT_GID) <= to_char(to_date('31-JUL-2013', 'DD-MON-YYYY'), 'dd-mon-yyyy')
--AND INV.DOMAIN_NAME = 'UPS/CP/VZNB'
--and V.INVOICE_GID(+) = inv.invoice_gid
and si.shipment_gid(+) = SHIP_BUY.SHIPMENT_GID
AND SI.INVOICE_GID = INV.INVOICE_GID(+)
and SHIP_BUY.INSERT_DATE > '1-JAN-2007'
and INV.USER_DEFINED1_ICON_GID = 'ACCEPTED'
GROUP BY corporation_name,SHIP_BUY.SHIPMENT_GID,SHIP_BUY.SERVPROV_GID,ship_buy.domain_name,inv.invoice_gid
ORDER BY CUSTER_NAME, BUY_SHIPMENT_GID;
And I generated the execution plan :
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 3 | 448 | 415 (2)| 00:00:05 |
| 1 | SORT UNIQUE | | 3 | 448 | 414 (87)| 00:00:05 |
| 2 | UNION-ALL | | | | | |
| 3 | NESTED LOOPS OUTER | | 3 | 384 | 57 (0)| 00:00:01 |
|* 4 | HASH JOIN | | 3 | 294 | 54 (0)| 00:00:01 |
|* 5 | TABLE ACCESS BY INDEX ROWID | SHIPMENT | 3 | 195 | 40 (0)| 00:00:01 |
|* 6 | INDEX SKIP SCAN | IND_SHIP_DOM_ICON | 54 | | 25 (0)| 00:00:01 |
|* 7 | TABLE ACCESS FULL | CORPORATION | 4 | 132 | 14 (0)| 00:00:01 |
|* 8 | INDEX RANGE SCAN | IND_INVOICESHIP_SHP_GID | 1 | 30 | 1 (0)| 00:00:01 |
| 9 | HASH GROUP BY | | 1 | 192 | 356 (1)| 00:00:05 |
|* 10 | HASH JOIN | | 1 | 192 | 354 (1)| 00:00:05 |
| 11 | NESTED LOOPS | | | | | |
| 12 | NESTED LOOPS | | 1 | 159 | 339 (0)| 00:00:05 |
| 13 | NESTED LOOPS | | 145 | 13920 | 194 (0)| 00:00:03 |
| 14 | TABLE ACCESS BY INDEX ROWID| INVOICE | 145 | 5220 | 49 (0)| 00:00:01 |
|* 15 | INDEX SKIP SCAN | IDX_INV_TYP_ICON_NAM | 145 | | 17 (0)| 00:00:01 |
|* 16 | INDEX RANGE SCAN | UK_INVOICE_SHIPMENT | 1 | 60 | 1 (0)| 00:00:01 |
|* 17 | INDEX UNIQUE SCAN | PK_SHIPMENT | 1 | | 1 (0)| 00:00:01 |
|* 18 | TABLE ACCESS BY INDEX ROWID | SHIPMENT | 1 | 63 | 1 (0)| 00:00:01 |
|* 19 | TABLE ACCESS FULL | CORPORATION | 4 | 132 | 14 (0)| 00:00:01 |
Predicate Information (identified by operation id):
4 - access("CORP"."DOMAIN_NAME"="SHIP_BUY"."DOMAIN_NAME")
5 - filter("F_GET_POD_RECEIVED_DATE"("SHIP_BUY"."SHIPMENT_GID")<=TO_DATE(' 2013-07-31 00:00:00',
'syyyy-mm-dd hh24:mi:ss') AND "SHIP_BUY"."INSERT_DATE">TO_DATE(' 2007-01-01 00:00:00', 'syyyy-mm-dd
hh24:mi:ss'))
6 - access("SHIP_BUY"."USER_DEFINED1_ICON_GID"='ACCEPTED' AND "SHIP_BUY"."DOMAIN_NAME" LIKE
'UPS/CP/DFP/%')
filter("SHIP_BUY"."DOMAIN_NAME" LIKE 'UPS/CP/DFP/%' AND
"SHIP_BUY"."USER_DEFINED1_ICON_GID"='ACCEPTED')
7 - filter("CORP"."IS_DOMAIN_MASTER"='Y' AND "CORP"."DOMAIN_NAME" LIKE 'UPS/CP/DFP/%')
8 - access("SI"."SHIPMENT_GID"(+)="SHIP_BUY"."SHIPMENT_GID")
10 - access("CORP"."DOMAIN_NAME"="SHIP_BUY"."DOMAIN_NAME")
15 - access("INV"."USER_DEFINED1_ICON_GID"='ACCEPTED')
filter("INV"."USER_DEFINED1_ICON_GID"='ACCEPTED')
16 - access("SI"."INVOICE_GID"="INV"."INVOICE_GID")
17 - access("SI"."SHIPMENT_GID"="SHIP_BUY"."SHIPMENT_GID")
filter("F_GET_POD_RECEIVED_DATE"("SHIP_BUY"."SHIPMENT_GID")<=TO_DATE(' 2013-07-31 00:00:00',
'syyyy-mm-dd hh24:mi:ss'))
18 - filter("SHIP_BUY"."DOMAIN_NAME" LIKE 'UPS/CP/DFP/%' AND "SHIP_BUY"."INSERT_DATE">TO_DATE('
2007-01-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))
19 - filter("CORP"."IS_DOMAIN_MASTER"='Y' AND "CORP"."DOMAIN_NAME" LIKE 'UPS/CP/DFP/%')
Statistics
246247 recursive calls
2 db block gets
1660067 consistent gets
13839 physical reads
0 redo size
592054 bytes sent via SQL*Net to client
6024 bytes received via SQL*Net from client
502 SQL*Net roundtrips to/from client
15296 sorts (memory)
0 sorts (disk)
7513 rows processedHmmm...why does this look familiar?
F_GET_POD_RECEIVED_DATE (ship_BUY.SHIPMENT_GID) <= to_char(to_date('31-JUL-2013', 'DD-MON-YYYY'), 'dd-mon-yyyy')
SHIP_BUY.INSERT_DATE > '1-JAN-2007'
Like I said in your other thread about this, these two lines need to be fixed and your function needs to be fixed so the return statement doesn't do an implicit date conversion.
Can't you see what that first line is doing? You're taking a character string, turning it into a date, then back to a character string.
If nothing else, these lines should be...
F_GET_POD_RECEIVED_DATE (ship_BUY.SHIPMENT_GID) <= to_date('31-JUL-2013', 'DD-MON-YYYY')
SHIP_BUY.INSERT_DATE > to_date('01-JAN-2007','DD-MON-YYYY')
(assuming insert_date is a proper date format, fingers crossed) -
Help needed to tune the Query:Statistics added
Can someone DBA please help me to tune this query:
SELECT DISTINCT K.ATTRIBUTE_VALUE AGENCY_ID,B.PROFILE_NM ,NVL(G.OFFICE_DESC,'--') OFFICE_DESC,f.OFFICE_ID,B.PROFILE_ID,'%' ROLE,'%' LAYOUT,
CASE
WHEN 'flagB' = '%' THEN
NVL(J.ISS_GRP_DESC,'BILLING')
WHEN 'flagO' = '%' THEN
NVL(J.ISS_GRP_DESC,'ORDERING')
WHEN 'flag' = '%' THEN
NVL(J.ISS_GRP_DESC,'BILLING/ORDERING')
ELSE
NVL(J.ISS_GRP_DESC,' ')
END ISS_GRP_DESC,
DECODE(NVL(H.USERID,' ') ,' ','--','<a sbcuid_in=' || H.USERID || ' target=NEW >'||H.FIRSTNAME || ' ' || H.LASTNAME || '( ' || H.USERID || ' )</a>' ) USER_NAME
FROM
PROFILE_PORTAL B ,
TBL_BDA_AGENCY_RESP_REP C ,
TBL_BDA_AGENCY_OFFICE F,
TBL_BDA_OFFICE G,
USERS_PORTAL H,
TBL_BDA_USR_ISS_GRP I ,
TBL_BDA_ISS_GROUP J,
ATTRIBUTE_VALUES_PORTAL K,
PROFILE_TYPE_PORTAL L
WHERE
B.PROFILE_ID = F.AGENCY_ID (+)
AND B.PROFILE_ID = C.AGENCY_ID (+)
AND G.OFFICE_ID (+)= F.OFFICE_ID
AND H.USERID (+)= C.RESP_USR_ID
AND C.ISS_GRP_ID = I.ISS_GRP_ID (+)
AND I.ISS_GRP_ID = J.ISS_GRP_ID(+)
AND 'PROFILE.'||B.PROFILE_ID = K.ENTITY_ID(+)
AND K.ATTRIBUTE_VALUE IS NOT NULL
AND L.PROFILE_TYPE_ID = B.PROFILE_TYPE_ID
AND L.APPLICATION_CD='BDA'
AND NOT EXISTS (SELECT agency_id
FROM TBL_BDA_AGENCY_RESP_REP t
WHERE t.ISS_GRP_ID IN ('%')
AND t.AGENCY_ID = C.AGENCY_ID)
AND K.ATTRIBUTE_VALUE LIKE '%'
AND UPPER(B.PROFILE_NM) LIKE UPPER('%')
AND (to_char(NVL(B.PROFILE_ID,0)) LIKE '%' OR NVL(B.PROFILE_ID,0) IN ('a'))
AND NVL(G.OFFICE_ID,0) IN ('%')
AND (to_char(NVL(C.RESP_USR_ID,'0')) LIKE '%' OR NVL(C.RESP_USR_ID,'0') IN ('k'))
ORDER BY PROFILE_NM
The number of rows in these tables are as follows:
PROFILE_PORTAL -- 2392
TBL_BDA_AGENCY_RESP_REP 3508
TBL_BDA_AGENCY_OFFICE 2151
TBL_BDA_OFFICE 3
USERS_PORTAL 270500
TBL_BDA_USR_ISS_GRP 234
TBL_BDA_ISS_GROUP 2
ATTRIBUTE_VALUES_PORTAL 2790
PROFILE_TYPE_PORTAL 3
The Explain pal nhas given this o/p to me:
SQL> select * from table(dbms_xplan.display) dual;
PLAN_TABLE_OUTPUT
| Id | Operation | Name | Rows | Bytes |TempSpc| Cost |
| 0 | SELECT STATEMENT | | 807 | 102K| | 2533 |
| 1 | SORT UNIQUE | | 807 | 102K| 232K| 82 |
|* 2 | FILTER | | | | | |
|* 3 | HASH JOIN OUTER | | 807 | 102K| | 52 |
|* 4 | HASH JOIN OUTER | | 807 | 95226 | | 40 |
|* 5 | TABLE ACCESS BY INDEX ROWID | ATTRIBUTE_VALUES | 1 | 23 | | 2 |
| 6 | NESTED LOOPS | | 7 | 805 | | 37 |
| 7 | NESTED LOOPS OUTER | | 6 | 552 | | 25 |
|* 8 | FILTER | | | | | |
| 9 | NESTED LOOPS OUTER | | | | | |
|* 10 | FILTER | | | | | |
| 11 | NESTED LOOPS OUTER | | | | | |
| 12 | NESTED LOOPS OUTER | | 3 | 141 | | 10 |
|* 13 | HASH JOIN | | 3 | 120 | | 7 |
|* 14 | TABLE ACCESS FULL | PROFILE | 6 | 198 | | 4 |
|* 15 | TABLE ACCESS FULL | PROFILE_TYPE | 1 | 7 | | 2 |
|* 16 | INDEX RANGE SCAN | SYS_C0019777 | 1 | 7 | | 1 |
| 17 | TABLE ACCESS BY INDEX ROWID| TBL_BDA_OFFICE | 1 | 10 | | 1 |
|* 18 | INDEX UNIQUE SCAN | SYS_C0019800 | 1 | | | |
| 19 | TABLE ACCESS BY INDEX ROWID | TBL_BDA_AGENCY_RESP_REP | 2 | 26 | | 2 |
|* 20 | INDEX RANGE SCAN | IDX_AGECYRESP_AGNCYID | 2 | | | 1 |
| 21 | TABLE ACCESS BY INDEX ROWID | USER_ | 1 | 22 | | 1 |
|* 22 | INDEX UNIQUE SCAN | USER_PK | 1 | | | |
|* 23 | INDEX RANGE SCAN | IDX_ATTVAL_ENTATTID | 1 | | | 1 |
| 24 | TABLE ACCESS FULL | TBL_BDA_USR_ISS_GRP | 234 | 702 | | 2 |
| 25 | TABLE ACCESS FULL | TBL_BDA_ISS_GROUP | 2 | 24 | | 2 |
|* 26 | TABLE ACCESS BY INDEX ROWID | TBL_BDA_AGENCY_RESP_REP | 1 | 7 | | 3 |
|* 27 | INDEX RANGE SCAN | IDX_AGECYRESP_AGNCYID | 2 | | | 1 |
Predicate Information (identified by operation id):
2 - filter( NOT EXISTS (SELECT /*+ */ 0 FROM "TBL_BDA_AGENCY_RESP_REP" "T" WHERE "T"."AGENCY_ID"=:B1
AND "T"."ISS_GRP_ID"=TO_NUMBER('%')))
3 - access("I"."ISS_GRP_ID"="J"."ISS_GRP_ID"(+))
4 - access("SYS_ALIAS_1"."ISS_GRP_ID"="I"."ISS_GRP_ID"(+))
5 - filter("K"."ATTRIBUTE_VALUE" IS NOT NULL AND "K"."ATTRIBUTE_VALUE" LIKE '%')
8 - filter(NVL("SYS_ALIAS_1"."RESP_USR_ID",'0') LIKE '%' OR NVL("SYS_ALIAS_1"."RESP_USR_ID",'0')='k')
10 - filter(NVL("G"."OFFICE_ID",0)=TO_NUMBER('%'))
13 - access("L"."PROFILE_TYPE_ID"="B"."PROFILE_TYPE_ID")
14 - filter(UPPER("B"."PROFILE_NM") LIKE '%' AND (TO_CHAR(NVL("B"."PROFILE_ID",0)) LIKE '%' OR
NVL("B"."PROFILE_ID",0)=TO_NUMBER('a')))
15 - filter("L"."APPLICATION_CD"='BDA')
16 - access("B"."PROFILE_ID"="F"."AGENCY_ID"(+))
18 - access("G"."OFFICE_ID"(+)="F"."OFFICE_ID")
20 - access("B"."PROFILE_ID"="SYS_ALIAS_1"."AGENCY_ID"(+))
22 - access("H"."USERID"(+)="SYS_ALIAS_1"."RESP_USR_ID")
23 - access("K"."ENTITY_ID"='PROFILE.'||TO_CHAR("B"."PROFILE_ID"))
26 - filter("T"."ISS_GRP_ID"=TO_NUMBER('%'))
27 - access("T"."AGENCY_ID"=:B1)
Note: cpu costing is off
57 rows selected.
Elapsed: 00:00:01.08
Please help me.
Aashish S.Hello Eric,
Here is the code:
SELECT DISTINCT
K.ATTRIBUTE_VALUE AGENCY_ID,
B.PROFILE_NM ,
NVL(G.OFFICE_DESC,'--') OFFICE_DESC,
f.OFFICE_ID,
B.PROFILE_ID,
'%' ROLE,
'%' LAYOUT,
case
WHEN 'flagB' = '%' THEN
NVL(J.ISS_GRP_DESC,'BILLING')
WHEN 'flagO' = '%' THEN
NVL(J.ISS_GRP_DESC,'ORDERING')
WHEN 'flag' = '%' THEN
NVL(J.ISS_GRP_DESC,'BILLING/ORDERING')
else
NVL(J.ISS_GRP_DESC,' ')
END ISS_GRP_DESC,
DECODE(NVL(H.USERID,' ') ,' ','--','<a sbcuid_in=' || H.USERID || ' target=NEW >'||H.FIRSTNAME || ' ' || H.LASTNAME ||
'( ' || H.USERID || ' )</a>' ) USER_NAME
from
PROFILE_PORTAL B ,
TBL_BDA_AGENCY_RESP_REP C ,
TBL_BDA_AGENCY_OFFICE F,
TBL_BDA_OFFICE G,
USERS_PORTAL H,
TBL_BDA_USR_ISS_GRP I ,
TBL_BDA_ISS_GROUP J,
ATTRIBUTE_VALUES_PORTAL K,
PROFILE_TYPE_PORTAL L
WHERE
B.PROFILE_ID = F.AGENCY_ID (+)
AND B.PROFILE_ID = C.AGENCY_ID (+)
AND G.OFFICE_ID (+)= F.OFFICE_ID
AND H.USERID (+)= C.RESP_USR_ID
AND C.ISS_GRP_ID = I.ISS_GRP_ID (+)
AND I.ISS_GRP_ID = J.ISS_GRP_ID(+)
AND 'PROFILE.'||B.PROFILE_ID = K.ENTITY_ID(+)
AND K.ATTRIBUTE_VALUE IS NOT NULL
AND L.PROFILE_TYPE_ID = B.PROFILE_TYPE_ID
AND L.APPLICATION_CD='BDA'
AND NOT EXISTS
(SELECT agency_id
FROM TBL_BDA_AGENCY_RESP_REP t
WHERE t.ISS_GRP_ID IN (1)
AND t.AGENCY_ID = C.AGENCY_ID)
AND K.ATTRIBUTE_VALUE LIKE '%'
AND UPPER(B.PROFILE_NM) LIKE UPPER('%')
AND (to_char(NVL(B.PROFILE_ID,0))
LIKE '%'
OR NVL(B.PROFILE_ID,0) IN (1))
AND NVL(G.OFFICE_ID,0) IN (1)
AND (to_char(NVL(C.RESP_USR_ID,'0'))
LIKE '%'
OR NVL(C.RESP_USR_ID,'0') IN ('%'))
ORDER BY PROFILE_NM
This is the Query and the query takes some mins. to run in prod environment.
From the Query plan ,I am not able to get any idea for optimization.
Now,Can you tell me which steps I need to follow to run it faster and which all modifications should be made?
Thanks.
Aashish S. -
Urgent help required: Query regarding LC Variables
Hi All
Sometime earlier I was working on a performance issue raised by a customer. It was shell script that was taking almost 8-9 hrs to complete. During my research I came across a fact that there were some variables which were not set, the LC variables were impacting the sort funnel operations because of which the script was taking a long time to execute.
I asked them to export the following commands, after which the program went on smoothly and finished in a couple of mins:
export LC_COLLATE=en_US.ISO8859-1
export LC_MESSAGES=C
export LC_MONETARY=en_US.ISO8859-1
export LC_MONETARY=en_US.ISO8859-1
export HZ=100
export LC_CTYPE=en_US.ISO8859-1
export LANG=en_US.UTF-8
Later I did recover that setting the LC_COLLATE to C, is not helping and the program was again taking a lot of time. Few questions that I want to ask are:
1. Can someone please tell me, what each of these variable mean and how these values make a difference.
2. When I exported LC_COLLATE=en_US.ISO8859-1, it worked fine, but when i tried with the defalut value LC_COLLATE=C, then why the program didnt work.
As this issue is still going on, hence I would request All to provide their valuable inputs and let me know as much as possible.
Appreciate your help in this regard.
Thanks
Amit
Hi All
A new development in this regard. The customer has send us a screen shot in which they were trying to export the locale variable using the commands which I have pasted above. I can see in the screen shot that while exporting LC_COLLATE and LC_TYPE, they get a message that ""ksh: export: couldn't set locale correctly"".
Request everyone to please give their inputs as it's a bit urgent.
Thanks for all the help in advance.
Thanks
Amit
Some help required please...
Edited by: amitsinhaengg on Jul 22, 2009 2:03 AM
Edited by: amitsinhaengg on Jul 22, 2009 2:06 AMLC_CTYPE
Controls the behavior of character handling functions.
LC_TIME
Specifies date and time formats, including month names, days of the week, and common full and abbreviated representations.
LC_MONETARY
Specifies monetary formats, including the currency symbol for the locale, thousands separator, sign position, the number of fractional digits, and so forth.
LC_NUMERIC
Specifies the decimal delimiter (or radix character), the thousands separator, and the grouping.
LC_COLLATE
Specifies a collation order and regular expression definition for the locale.
LC_MESSAGES
Specifies the language in which the localized messages are written, and affirmative and negative responses of the locale (yes and no strings and expressions).
You can use command
# locale -k LC_CTYPE
to see more detail about each type. -
my Ipod requires i tunes version 10.6.3 or later to be seen on itunes in my mac, I haven't been able to do that, how can I?
You get it here:
iTunes 10.6.3 -
Help required - Sales order item is partially delivered but the item grayed
I have a sales order 123 having say item10 with qty 1, item20 with qty 10 , item 30 qty 12
Item 1 confirmed qty 1 and delivered qty is 1
Item 2 confirmed qty 10 and delivered qty 10
Item 3 confirmed qty 1 and delivered qty is 1
Now the item3 still has open requirements of 11 to be delivered. But the item is GRAYED OUT already.
even if I do ATP the qty is not confirming for the remaining 11 pieces.
Why is that? How to make that item out from GRAY.
How to confirm the remaining 11 qty for that item.
Help required as early as possible.
Appreciate ur help guys
Radhahi Radha, how are you ?
---the partial deliveries in master data must have not been mentioned.
---the deliveries should be upto target quantity.
---check order type, item category and schedule line category.
---check unrestricted stock availability.
thank you
regards
Khera. -
Search Help with in a serach help required in SRM 4.0
Hi,
Requirement: Search help required for Product Category field in the Search help for Product(BBPH_PRODUCT) in SRM portal.
This search help is used in Create shopping Cart transaction. The hyper link on Internal Goods/Services leads to the search help BBPH_PRODUCT.
My analysis:
The field Product Category (CATEGORY_ID) has search help(COM_CAT_HIER) attached to its data element. When I single test the search help BBPH_PRODUCT in SAP GUI,I can see the search help for field product category in the selection dialogue box. However the same does not appear on the corresponding screen in HTML.
Please let me know whether I need to do some thing to make the search help appear on the HTML screen?
With Regards,
Prakash KamathHi Prakash,
I have the same problem but with another field. Unloading point. Could you please tell me how did you solve this problem with displaying F4 help on html/ SRM portal?
Thank you very much.
Best regards,
Danijela ZIvanovic -
Help required with Photoshop Elements 4.0 this has been installed on my new Toshiba laptop with windows 8.1 for some 18 months and operating well. Now it will not open, message pops up saying “attempt to access invalid address” then “application not responding” Suggestions how to access would be much appreciated. Tks. Stuart
What is the size of your hard disk? PSE 4 is a very old program and I suspect it is not able to access the entire hard disk on your machine. Just a thought here.
-
Help require with installing Adobe Acrobat onto my Macbook Pro Retina.
Help require with installing Adobe Acrobat onto my Macbook Pro Retina.
I have successfully installed all of my creative cloud apps with the exception being acrobat.
I cannot print from Indesign to PDF.
I have unistalled, reinstalled and still no Adobe Acrobat.
I now have to go back to Windows 8 and create the PDF's there.
Any one know how to get around this issue?
Thanks in advance
KelvinOSX has effectively killed the ability to print to pdf, (print to pdf eliminates most of the "Rich features" of current pdf).
Export from InDesign, always, excpet for the 1% of the time where you know why print to pdf would produce a better result. -
Help required in Weblogic 6 - Creation & Configuration of Web Application
Forum Home > Enterprise JavaBeans[tm]
Topic: Help required in Weblogic 6 - Creation & Configuration of Web Application
Duke Dollars
2 Duke Dollars assigned to this topic. Reward the best responses to your question
using the icons below, or transfer additional Duke Dollars to this topic.
Welcome moinshariff!
Watching this topic.
Previous Topic Next Topic
This topic has 1 reply on 1 page (Most recent message: Jan 23, 2002 1:05 AM)
Author: moinshariff Jan 22, 2002 4:55 AM
Hi,
I am using Weblogic 6. I have created a new Web
Application called Web (I have not used the DefaultWebApp_myserver).
And I have the following settings:
Name : Web
URI : Web
and Path : C:\Web
and placed my JSP files under c:\Web\
I am able to access the first page, but after that I am not able to access the
second page.
I get "Error 404--Not Found" on the browser. Basically the class file is not getting
created under /Web-inf/_tmp_war_myserver_myserver_Web/jsp_servlet/ folder .
I tried a work around for this. I copied all my files under one more folder called
web and placed this under C:\Web
The it works. Now I have 2 copied off all the files, 1 copy under c:\web and another
copy under c:\web\web\.
If I have the files under DefaultWebApp_myserver and have the setting as
Name: DefaultWebApp_myserver
URI: DefaultWebApp_myserver
Path: .\config\mydomain\applications
everything works fine.
Can any one please let me know if there is any configuration which has to be done
so that I do not duplicate the code in 2 directories
Thanks in advance.
Regards,
MoinForum Home > Enterprise JavaBeans[tm]
Topic: Help required in Weblogic 6 - Creation & Configuration of Web Application
Duke Dollars
2 Duke Dollars assigned to this topic. Reward the best responses to your question
using the icons below, or transfer additional Duke Dollars to this topic.
Welcome moinshariff!
Watching this topic.
Previous Topic Next Topic
This topic has 1 reply on 1 page (Most recent message: Jan 23, 2002 1:05 AM)
Author: moinshariff Jan 22, 2002 4:55 AM
Hi,
I am using Weblogic 6. I have created a new Web
Application called Web (I have not used the DefaultWebApp_myserver).
And I have the following settings:
Name : Web
URI : Web
and Path : C:\Web
and placed my JSP files under c:\Web\
I am able to access the first page, but after that I am not able to access the
second page.
I get "Error 404--Not Found" on the browser. Basically the class file is not getting
created under /Web-inf/_tmp_war_myserver_myserver_Web/jsp_servlet/ folder .
I tried a work around for this. I copied all my files under one more folder called
web and placed this under C:\Web
The it works. Now I have 2 copied off all the files, 1 copy under c:\web and another
copy under c:\web\web\.
If I have the files under DefaultWebApp_myserver and have the setting as
Name: DefaultWebApp_myserver
URI: DefaultWebApp_myserver
Path: .\config\mydomain\applications
everything works fine.
Can any one please let me know if there is any configuration which has to be done
so that I do not duplicate the code in 2 directories
Thanks in advance.
Regards,
Moin -
Help required network configuration - Gateway route settings get erased on reboot.
Oracle Linux 7
Linux myhostname 3.8.13-35.3.1.el7uek.x86_64 #2 SMP Wed Jun 25 15:27:43 PDT 2014 x86_64 x86_64 x86_64 GNU/Linux
#cat /etc/sysconfig/network-scripts/ifcfg-eno16780032
TYPE="Ethernet"
BOOTPROTO="none"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
NAME="eno16780032"
UUID="2d1107e3-8bd9-49b1-b726-701c56dc368b"
ONBOOT="yes"
IPADDR0="34.36.140.86"
PREFIX0="22"
GATEWAY0="34.36.143.254"
DNS1="34.36.132.1"
DNS2="34.34.132.1"
DOMAIN="corp.halliburton.com"
HWADDR="00:50:56:AC:3F:F9"
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"
NM_CONTROLLED="no"
#route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 34.36.143.254 0.0.0.0 UG 0 0 0 eno16780032
34.36.140.0 0.0.0.0 255.255.252.0 U 0 0 0 eno16780032
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eno16780032
When I reboot the machine, the first line in route table gets erased, I then run:
#route add default gw 34.36.143.254
After which network works fine.
Help required. I don't want to use NetworkManager.The following might be useful:
https://access.redhat.com/solutions/783533
"When transitioning from NetworkManager to using the network initscript, the default gateway parameter in the interface's ifcfg file will be depicted as 'GATEWAY0'. In order for the ifcfg file to be compatible with the network initscript, this parameter must be renamed to 'GATEWAY'. This limitation will be addressed in an upcoming release of RHEL7."
NetworkManager is now the default mechanism for RHEL 7. Personally I don't quite understand this, because as far as I can gather it is a program for systems to automatically detect and connect to known networks. I think such functionality can be useful when switching between wireless and wired networks, but for a server platform, I wonder.
Maybe you are looking for
-
USB devices don't appear in Sidebar or Finder but do appear on Desktop
After upgrading to Leopard from 10.3, I notice that when I plug a flash drive into the keyboard USB port of my 1.8 GHz iMac G5 the drive appears on the desktop, but not in the Finder or Sidebar. I believe this problem is also affecting PhoneValet, wh
-
I have lost the toolbar at the top of screwen how do i get it back
i have google as home page, but seemed to have lost the toolbar at top of my screen which has bookmarks and other info stored up there to make it easier for me to get to frequently used sites. Iam not real computer savvy so all this has been set up f
-
IPhone e-Mail bug: Text cut off below a picture
Hi Guys, Just discovered a very annoying bug in iPhone's mail client: If you are creating a new e-mail and paste a picture into it, the text below the picture will be cut off completely. So if you have a mail: "text before [PICTURE] text after" then
-
Display a warning message (text) for document up/download in cFolders
Hello, We are working in the development system of cProjects Suite 3.1 on the cFolders application. Lets say there is a collaboration which contains a folder which in turn contains a document. On clicking the document name the document details are di
-
Passing range table in a Subroutine
I got 3 select options like this: Tables : VBRK. *SELECTION SCREEN GUI SELECT-OPTIONS: so_fkdat FOR vbrk-fkdat OBLIGATORY, so_fkart FOR vbrk-fkart, so_vbeln FOR vbrk-vbeln. Now In the title of my alv I want to show what user hav input in these