Query HINT help requested Pls.

A query thus:
SELECT equipment_id,
vsemml.stock_equipment_id,
game_ware_id
FROM v_stocked_equipment_inven_his vsdeih,
v_stock_equipment_mod_man_list vsemml
WHERE vsemml.stock_equipment_id = vsdeih.stock_equipment_id(+)
AND equipment_status_code IN
('ALL', 'AVA' )
AND ec_end_date IS NULL
AND eav_end_date IS NULL
GROUP BY equipment_id,
vsemml.stock_equipment_id,
game_ware_id
HAVING COUNT (model_attribute_value_id) =
(SELECT COUNT (*)
FROM stock_equipment JOIN stock_equipment_attrib_value
USING (stock_equipment_id)
WHERE stock_equipment_id =
vsemml.stock_equipment_id);
has result :
513 rows selected.
Elapsed: 00:04:59.17
Execution Plan
Plan hash value: 3816309895
| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 240 | 21120 | | 38010 (7)| 00:07:37 |
|* 1 | FILTER | | | | | | |
| 2 | HASH GROUP BY | | 240 | 21120 | | 38010 (7)| 00:07:37 |
|* 3 | FILTER | | | | | | |
|* 4 | HASH JOIN OUTER | | 23915 | 2055K| | 38006 (7)| 00:07:37 |
|* 5 | HASH JOIN | | 42 | 630 | | 7 (15)| 00:00:01 |
| 6 | TABLE ACCESS FULL | MODEL | 31 | 279 | | 3 (0)| 00:00:01 |
| 7 | TABLE ACCESS FULL | STOCK_EQUIPMENT | 42 | 252 | | 3 (0)| 00:00:01 |
| 8 | VIEW | V_STOCKED_EQUIPMENT_INVEN_HIS | 23915 | 1704K| | 37998 (7)| 00:07:36 |
| 9 | HASH UNIQUE | | 23915 | 2989K| 6392K| 37998 (7)| 00:07:36 |
|* 10 | HASH JOIN RIGHT OUTER | | 23915 | 2989K| | 37307 (7)| 00:07:28 |
| 11 | TABLE ACCESS FULL | GAME_WARE | 325 | 1950 | | 3 (0)| 00:00:01 |
|* 12 | HASH JOIN RIGHT OUTER | | 23915 | 2849K| | 37303 (7)| 00:07:28 |
| 13 | TABLE ACCESS FULL | GAMESET | 825 | 8250 | | 5 (0)| 00:00:01 |
|* 14 | HASH JOIN | | 23915 | 2615K| | 37297 (7)| 00:07:28 |
| 15 | TABLE ACCESS FULL | EQUIPMENT_STATUS | 16 | 128 | | 3 (0)| 00:00:01 |
|* 16 | HASH JOIN | | 23915 | 2428K| | 37293 (7)| 00:07:28 |
| 17 | TABLE ACCESS FULL | STOCK_EQUIPMENT | 42 | 252 | | 3 (0)| 00:00:01 |
|* 18 | HASH JOIN | | 645K| 60M| | 37278 (7)| 00:07:28 |
| 19 | INDEX FULL SCAN | XPKSTOCK_EQUIPMENT_ATTRIB_VAL | 42 | 294 | | 1 (0)| 00:00:01 |
|* 20 | HASH JOIN | | 5288K| 458M| 9M| 37180 (7)| 00:07:27 |
| 21 | TABLE ACCESS FULL | EQUIPMENT_ATTRIBUTE_VALUE | 297K| 6672K| | 784 (3)| 00:00:10 |
|* 22 | HASH JOIN | | 7467K| 484M| 6328K| 5447 (5)| 00:01:06 |
| 23 | INDEX FAST FULL SCAN | PK_EQUIPMENT_CONFIGURATION | 380K| 1859K| | 398 (3)| 00:00:05 |
|* 24 | HASH JOIN | | 380K| 22M| 4528K| 3235 (2)| 00:00:39 |
|* 25 | HASH JOIN | | 140K| 2876K| | 563 (2)| 00:00:07 |
| 26 | MERGE JOIN | | 281 | 3372 | | 6 (17)| 00:00:01 |
| 27 | TABLE ACCESS BY INDEX ROWID| SITE_TYPE | 4 | 20 | | 2 (0)| 00:00:01 |
| 28 | INDEX FULL SCAN | PK_SITE_TYPE | 4 | | | 1 (0)| 00:00:01 |
|* 29 | SORT JOIN | | 281 | 1967 | | 4 (25)| 00:00:01 |
| 30 | VIEW | index$_join$_016 | 281 | 1967 | | 3 (0)| 00:00:01 |
|* 31 | HASH JOIN | | | | | | |
| 32 | INDEX FAST FULL SCAN | PK_SITE | 281 | 1967 | | 1 (0)| 00:00:01 |
| 33 | INDEX FAST FULL SCAN | XIF1SITE | 281 | 1967 | | 1 (0)| 00:00:01 |
| 34 | TABLE ACCESS FULL | LOCATION | 140K| 1232K| | 554 (2)| 00:00:07 |
| 35 | TABLE ACCESS FULL | EQUIPMENT_CONFIGURATION | 380K| 15M| | 1460 (2)| 00:00:18 |
| 36 | SORT AGGREGATE | | 1 | 6 | | | |
| 37 | NESTED LOOPS | | 1 | 6 | | 0 (0)| 00:00:01 |
|* 38 | INDEX UNIQUE SCAN | XPKSTOCK_EQUIPMENT | 1 | 3 | | 0 (0)| 00:00:01 |
|* 39 | INDEX RANGE SCAN | XIF1STOCK_EQUIPMENT_ATTRIB_VAL | 1 | 3 | | 0 (0)| 00:00:01 |
Predicate Information (identified by operation id):
1 - filter(COUNT("MODEL_ATTRIBUTE_VALUE_ID")= (SELECT COUNT(*) FROM "STOCK_EQUIPMENT_ATTRIB_VALUE"
"STOCK_EQUIPMENT_ATTRIB_VALUE","STOCK_EQUIPMENT" "STOCK_EQUIPMENT" WHERE "STOCK_EQUIPMENT"."STOCK_EQUIPMENT_ID"=:B1 AND
"STOCK_EQUIPMENT"."STOCK_EQUIPMENT_ID"="STOCK_EQUIPMENT_ATTRIB_VALUE"."STOCK_EQUIPMENT_ID" AND
"STOCK_EQUIPMENT_ATTRIB_VALUE"."STOCK_EQUIPMENT_ID"=:B2))
3 - filter(("EQUIPMENT_STATUS_CODE"='ALL' OR "EQUIPMENT_STATUS_CODE"='AVA') AND "EC_END_DATE" IS NULL AND "EAV_END_DATE"
IS NULL)
4 - access("SE"."STOCK_EQUIPMENT_ID"="VSDEIH"."STOCK_EQUIPMENT_ID"(+))
5 - access("SE"."MODEL_ID"="M"."MODEL_ID")
10 - access("GS"."GAME_WARE_ID"="GW"."GAME_WARE_ID"(+))
12 - access("EC"."GAMESET_ID"="GS"."GAMESET_ID"(+))
14 - access("EC"."EQUIPMENT_STATUS_ID"="ES"."EQUIPMENT_STATUS_ID")
16 - access("EC"."MODEL_ID"="STOCK_EQUIPMENT"."MODEL_ID" AND
"STOCK_EQUIPMENT"."STOCK_EQUIPMENT_ID"="STOCK_EQUIPMENT_ATTRIB_VALUE"."STOCK_EQUIPMENT_ID")
18 - access("MODEL_ATTRIBUTE_VALUE_ID"="STOCK_EQUIPMENT_ATTRIB_VALUE"."MODEL_ATTRIBUTE_VALUE_ID")
20 - access("EC"."EQUIPMENT_ID"="EAV"."EQUIPMENT_ID")
filter("EAV"."START_DATE">="EC"."START_DATE" AND ("EAV"."END_DATE" IS NULL AND "EC"."END_DATE">="EAV"."START_DATE" OR
"EC"."END_DATE" IS NULL OR "EAV"."END_DATE"<="EC"."END_DATE") OR "EC"."START_DATE">="EAV"."START_DATE" AND ("EC"."END_DATE"
IS NULL AND "EAV"."END_DATE">="EC"."START_DATE" OR "EAV"."END_DATE" IS NULL OR "EC"."END_DATE"<="EAV"."END_DATE"))
22 - access("EC"."EQUIPMENT_ID"="EC"."EQUIPMENT_ID")
24 - access("EC"."LOCATION_ID"="L"."LOCATION_ID")
25 - access("L"."SITE_ID"="S"."SITE_ID")
29 - access("S"."SITE_TYPE_ID"="ST"."SITE_TYPE_ID")
filter("S"."SITE_TYPE_ID"="ST"."SITE_TYPE_ID")
31 - access(ROWID=ROWID)
38 - access("STOCK_EQUIPMENT"."STOCK_EQUIPMENT_ID"=:B1)
39 - access("STOCK_EQUIPMENT"."STOCK_EQUIPMENT_ID"="STOCK_EQUIPMENT_ATTRIB_VALUE"."STOCK_EQUIPMENT_ID")
filter("STOCK_EQUIPMENT_ATTRIB_VALUE"."STOCK_EQUIPMENT_ID"=:B1)
Query altered to:
=================
SELECT equipment_id,
vsemml.stock_equipment_id,
game_ware_id
FROM v_stocked_equipment_inven_his vsdeih,
v_stock_equipment_mod_man_list vsemml
WHERE vsemml.stock_equipment_id = vsdeih.stock_equipment_id(+)
AND equipment_status_code = 'ALL'
AND ec_end_date IS NULL
AND eav_end_date IS NULL
GROUP BY equipment_id,
vsemml.stock_equipment_id,
game_ware_id
HAVING COUNT (model_attribute_value_id) =
(SELECT COUNT (*)
FROM stock_equipment JOIN stock_equipment_attrib_value
USING (stock_equipment_id)
WHERE stock_equipment_id =
vsemml.stock_equipment_id)
union
SELECT equipment_id,
vsemml.stock_equipment_id,
game_ware_id
FROM v_stocked_equipment_inven_his vsdeih,
v_stock_equipment_mod_man_list vsemml
WHERE vsemml.stock_equipment_id = vsdeih.stock_equipment_id(+)
AND equipment_status_code = 'AVA'
AND ec_end_date IS NULL
AND eav_end_date IS NULL
GROUP BY equipment_id,
vsemml.stock_equipment_id,
game_ware_id
HAVING COUNT (model_attribute_value_id) =
(SELECT COUNT (*)
FROM stock_equipment JOIN stock_equipment_attrib_value
USING (stock_equipment_id)
WHERE stock_equipment_id =
vsemml.stock_equipment_id);
Results in:
513 rows selected.
Elapsed: 00:00:07.40
Execution Plan
Plan hash value: 3317078232
| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 2 | 176 | | 6431 (51)| 00:01:18 |
| 1 | SORT UNIQUE | | 2 | 176 | | 6431 (51)| 00:01:18 |
| 2 | UNION-ALL | | | | | | |
|* 3 | FILTER | | | | | | |
| 4 | HASH GROUP BY | | 1 | 88 | | 3216 (2)| 00:00:39 |
|* 5 | HASH JOIN | | 95 | 8360 | | 3214 (2)| 00:00:39 |
|* 6 | HASH JOIN | | 42 | 630 | | 7 (15)| 00:00:01 |
| 7 | TABLE ACCESS FULL | MODEL | 31 | 279 | | 3 (0)| 00:00:01 |
| 8 | TABLE ACCESS FULL | STOCK_EQUIPMENT | 42 | 252 | | 3 (0)| 00:00:01 |
| 9 | VIEW | V_STOCKED_EQUIPMENT_INVEN_HIS | 95 | 6935 | | 3207 (2)| 00:00:39 |
| 10 | HASH UNIQUE | | 95 | 12160 | | 3207 (2)| 00:00:39 |
|* 11 | HASH JOIN RIGHT OUTER | | 95 | 12160 | | 3206 (2)| 00:00:39 |
| 12 | TABLE ACCESS FULL | GAME_WARE | 325 | 1950 | | 3 (0)| 00:00:01 |
|* 13 | HASH JOIN OUTER | | 95 | 11590 | | 3202 (2)| 00:00:39 |
|* 14 | HASH JOIN | | 95 | 10640 | | 3196 (2)| 00:00:39 |
| 15 | TABLE ACCESS FULL | SITE_TYPE | 4 | 20 | | 3 (0)| 00:00:01 |
|* 16 | HASH JOIN | | 95 | 10165 | | 3193 (2)| 00:00:39 |
| 17 | VIEW | index$_join$_021 | 281 | 1967 | | 3 (0)| 00:00:01 |
|* 18 | HASH JOIN | | | | | | |
| 19 | INDEX FAST FULL SCAN | PK_SITE | 281 | 1967 | | 1 (0)| 00:00:01 |
| 20 | INDEX FAST FULL SCAN | XIF1SITE | 281 | 1967 | | 1 (0)| 00:00:01 |
| 21 | NESTED LOOPS | | 95 | 9500 | | 3189 (2)| 00:00:39 |
|* 22 | HASH JOIN | | 96 | 8736 | 4440K| 3093 (2)| 00:00:38 |
|* 23 | HASH JOIN | | 56789 | 3771K| | 1679 (2)| 00:00:21 |
|* 24 | HASH JOIN | | 2894 | 178K| | 1273 (1)| 00:00:16 |
| 25 | INDEX FULL SCAN | XPKSTOCK_EQUIPMENT_ATTRIB_VAL | 42 | 294 | | 1 (0)| 00:00:01 |
|* 26 | HASH JOIN | | 2894 | 158K| | 1271 (1)| 00:00:16 |
| 27 | TABLE ACCESS FULL | STOCK_EQUIPMENT | 42 | 252 | | 3 (0)| 00:00:01 |
|* 28 | TABLE ACCESS BY INDEX ROWID| EQUIPMENT_CONFIGURATION | 1279 | 53718 | | 1265 (1)| 00:00:16 |
| 29 | NESTED LOOPS | | 1860 | 93000 | | 1268 (1)| 00:00:16 |
|* 30 | TABLE ACCESS FULL | EQUIPMENT_STATUS | 1 | 8 | | 3 (0)| 00:00:01 |
|* 31 | INDEX RANGE SCAN | XIF3EQUIPMENT_CONFIGURATION | 23796 | | | 48 (3)| 00:00:01 |
| 32 | INDEX FAST FULL SCAN | PK_EQUIPMENT_CONFIGURATION | 380K| 1859K| | 398 (3)| 00:00:05 |
|* 33 | TABLE ACCESS FULL | EQUIPMENT_ATTRIBUTE_VALUE | 242K| 5451K| | 785 (3)| 00:00:10 |
| 34 | TABLE ACCESS BY INDEX ROWID | LOCATION | 1 | 9 | | 1 (0)| 00:00:01 |
|* 35 | INDEX UNIQUE SCAN | PK_LOCATION | 1 | | | 0 (0)| 00:00:01 |
| 36 | TABLE ACCESS FULL | GAMESET | 825 | 8250 | | 5 (0)| 00:00:01 |
| 37 | SORT AGGREGATE | | 1 | 6 | | | |
| 38 | NESTED LOOPS | | 1 | 6 | | 0 (0)| 00:00:01 |
|* 39 | INDEX UNIQUE SCAN | XPKSTOCK_EQUIPMENT | 1 | 3 | | 0 (0)| 00:00:01 |
|* 40 | INDEX RANGE SCAN | XIF1STOCK_EQUIPMENT_ATTRIB_VAL | 1 | 3 | | 0 (0)| 00:00:01 |
|* 41 | FILTER | | | | | | |
| 42 | HASH GROUP BY | | 1 | 88 | | 3216 (2)| 00:00:39 |
|* 43 | HASH JOIN | | 95 | 8360 | | 3214 (2)| 00:00:39 |
|* 44 | HASH JOIN | | 42 | 630 | | 7 (15)| 00:00:01 |
| 45 | TABLE ACCESS FULL | MODEL | 31 | 279 | | 3 (0)| 00:00:01 |
| 46 | TABLE ACCESS FULL | STOCK_EQUIPMENT | 42 | 252 | | 3 (0)| 00:00:01 |
| 47 | VIEW | V_STOCKED_EQUIPMENT_INVEN_HIS | 95 | 6935 | | 3207 (2)| 00:00:39 |
| 48 | HASH UNIQUE | | 95 | 12160 | | 3207 (2)| 00:00:39 |
|* 49 | HASH JOIN RIGHT OUTER | | 95 | 12160 | | 3206 (2)| 00:00:39 |
| 50 | TABLE ACCESS FULL | GAME_WARE | 325 | 1950 | | 3 (0)| 00:00:01 |
|* 51 | HASH JOIN OUTER | | 95 | 11590 | | 3202 (2)| 00:00:39 |
|* 52 | HASH JOIN | | 95 | 10640 | | 3196 (2)| 00:00:39 |
| 53 | TABLE ACCESS FULL | SITE_TYPE | 4 | 20 | | 3 (0)| 00:00:01 |
|* 54 | HASH JOIN | | 95 | 10165 | | 3193 (2)| 00:00:39 |
| 55 | VIEW | index$_join$_044 | 281 | 1967 | | 3 (0)| 00:00:01 |
|* 56 | HASH JOIN | | | | | | |
| 57 | INDEX FAST FULL SCAN | PK_SITE | 281 | 1967 | | 1 (0)| 00:00:01 |
| 58 | INDEX FAST FULL SCAN | XIF1SITE | 281 | 1967 | | 1 (0)| 00:00:01 |
| 59 | NESTED LOOPS | | 95 | 9500 | | 3189 (2)| 00:00:39 |
|* 60 | HASH JOIN | | 96 | 8736 | 4440K| 3093 (2)| 00:00:38 |
|* 61 | HASH JOIN | | 56789 | 3771K| | 1679 (2)| 00:00:21 |
|* 62 | HASH JOIN | | 2894 | 178K| | 1273 (1)| 00:00:16 |
| 63 | INDEX FULL SCAN | XPKSTOCK_EQUIPMENT_ATTRIB_VAL | 42 | 294 | | 1 (0)| 00:00:01 |
|* 64 | HASH JOIN | | 2894 | 158K| | 1271 (1)| 00:00:16 |
| 65 | TABLE ACCESS FULL | STOCK_EQUIPMENT | 42 | 252 | | 3 (0)| 00:00:01 |
|* 66 | TABLE ACCESS BY INDEX ROWID| EQUIPMENT_CONFIGURATION | 1279 | 53718 | | 1265 (1)| 00:00:16 |
| 67 | NESTED LOOPS | | 1860 | 93000 | | 1268 (1)| 00:00:16 |
|* 68 | TABLE ACCESS FULL | EQUIPMENT_STATUS | 1 | 8 | | 3 (0)| 00:00:01 |
|* 69 | INDEX RANGE SCAN | XIF3EQUIPMENT_CONFIGURATION | 23796 | | | 48 (3)| 00:00:01 |
| 70 | INDEX FAST FULL SCAN | PK_EQUIPMENT_CONFIGURATION | 380K| 1859K| | 398 (3)| 00:00:05 |
|* 71 | TABLE ACCESS FULL | EQUIPMENT_ATTRIBUTE_VALUE | 242K| 5451K| | 785 (3)| 00:00:10 |
| 72 | TABLE ACCESS BY INDEX ROWID | LOCATION | 1 | 9 | | 1 (0)| 00:00:01 |
|* 73 | INDEX UNIQUE SCAN | PK_LOCATION | 1 | | | 0 (0)| 00:00:01 |
| 74 | TABLE ACCESS FULL | GAMESET | 825 | 8250 | | 5 (0)| 00:00:01 |
| 75 | SORT AGGREGATE | | 1 | 6 | | | |
| 76 | NESTED LOOPS | | 1 | 6 | | 0 (0)| 00:00:01 |
|* 77 | INDEX UNIQUE SCAN | XPKSTOCK_EQUIPMENT | 1 | 3 | | 0 (0)| 00:00:01 |
|* 78 | INDEX RANGE SCAN | XIF1STOCK_EQUIPMENT_ATTRIB_VAL | 1 | 3 | | 0 (0)| 00:00:01 |
Predicate Information (identified by operation id):
3 - filter(COUNT("MODEL_ATTRIBUTE_VALUE_ID")= (SELECT COUNT(*) FROM "STOCK_EQUIPMENT_ATTRIB_VALUE"
"STOCK_EQUIPMENT_ATTRIB_VALUE","STOCK_EQUIPMENT" "STOCK_EQUIPMENT" WHERE "STOCK_EQUIPMENT"."STOCK_EQUIPMENT_ID"=:B1 AND
"STOCK_EQUIPMENT"."STOCK_EQUIPMENT_ID"="STOCK_EQUIPMENT_ATTRIB_VALUE"."STOCK_EQUIPMENT_ID" AND
"STOCK_EQUIPMENT_ATTRIB_VALUE"."STOCK_EQUIPMENT_ID"=:B2))
5 - access("SE"."STOCK_EQUIPMENT_ID"="VSDEIH"."STOCK_EQUIPMENT_ID")
6 - access("SE"."MODEL_ID"="M"."MODEL_ID")
11 - access("GS"."GAME_WARE_ID"="GW"."GAME_WARE_ID"(+))
13 - access("EC"."GAMESET_ID"="GS"."GAMESET_ID"(+))
14 - access("S"."SITE_TYPE_ID"="ST"."SITE_TYPE_ID")
16 - access("L"."SITE_ID"="S"."SITE_ID")
18 - access(ROWID=ROWID)
22 - access("MODEL_ATTRIBUTE_VALUE_ID"="STOCK_EQUIPMENT_ATTRIB_VALUE"."MODEL_ATTRIBUTE_VALUE_ID" AND
"EC"."EQUIPMENT_ID"="EAV"."EQUIPMENT_ID")
filter("EAV"."START_DATE">="EC"."START_DATE" AND ("EAV"."END_DATE" IS NULL AND "EC"."END_DATE">="EAV"."START_DATE" OR
"EC"."END_DATE" IS NULL OR "EAV"."END_DATE"<="EC"."END_DATE") OR "EC"."START_DATE">="EAV"."START_DATE" AND ("EC"."END_DATE"
IS NULL AND "EAV"."END_DATE">="EC"."START_DATE" OR "EAV"."END_DATE" IS NULL OR "EC"."END_DATE"<="EAV"."END_DATE"))
23 - access("EC"."EQUIPMENT_ID"="EC"."EQUIPMENT_ID")
24 - access("STOCK_EQUIPMENT"."STOCK_EQUIPMENT_ID"="STOCK_EQUIPMENT_ATTRIB_VALUE"."STOCK_EQUIPMENT_ID")
26 - access("EC"."MODEL_ID"="STOCK_EQUIPMENT"."MODEL_ID")
28 - filter("EC"."END_DATE" IS NULL)
30 - filter("ES"."EQUIPMENT_STATUS_CODE"='ALL')
31 - access("EC"."EQUIPMENT_STATUS_ID"="ES"."EQUIPMENT_STATUS_ID")
33 - filter("EAV"."END_DATE" IS NULL)
35 - access("EC"."LOCATION_ID"="L"."LOCATION_ID")
39 - access("STOCK_EQUIPMENT"."STOCK_EQUIPMENT_ID"=:B1)
40 - access("STOCK_EQUIPMENT"."STOCK_EQUIPMENT_ID"="STOCK_EQUIPMENT_ATTRIB_VALUE"."STOCK_EQUIPMENT_ID")
filter("STOCK_EQUIPMENT_ATTRIB_VALUE"."STOCK_EQUIPMENT_ID"=:B1)
41 - filter(COUNT("MODEL_ATTRIBUTE_VALUE_ID")= (SELECT COUNT(*) FROM "STOCK_EQUIPMENT_ATTRIB_VALUE"
"STOCK_EQUIPMENT_ATTRIB_VALUE","STOCK_EQUIPMENT" "STOCK_EQUIPMENT" WHERE "STOCK_EQUIPMENT"."STOCK_EQUIPMENT_ID"=:B1 AND
"STOCK_EQUIPMENT"."STOCK_EQUIPMENT_ID"="STOCK_EQUIPMENT_ATTRIB_VALUE"."STOCK_EQUIPMENT_ID" AND
"STOCK_EQUIPMENT_ATTRIB_VALUE"."STOCK_EQUIPMENT_ID"=:B2))
43 - access("SE"."STOCK_EQUIPMENT_ID"="VSDEIH"."STOCK_EQUIPMENT_ID")
44 - access("SE"."MODEL_ID"="M"."MODEL_ID")
49 - access("GS"."GAME_WARE_ID"="GW"."GAME_WARE_ID"(+))
51 - access("EC"."GAMESET_ID"="GS"."GAMESET_ID"(+))
52 - access("S"."SITE_TYPE_ID"="ST"."SITE_TYPE_ID")
54 - access("L"."SITE_ID"="S"."SITE_ID")
56 - access(ROWID=ROWID)
60 - access("MODEL_ATTRIBUTE_VALUE_ID"="STOCK_EQUIPMENT_ATTRIB_VALUE"."MODEL_ATTRIBUTE_VALUE_ID" AND
"EC"."EQUIPMENT_ID"="EAV"."EQUIPMENT_ID")
filter("EAV"."START_DATE">="EC"."START_DATE" AND ("EAV"."END_DATE" IS NULL AND "EC"."END_DATE">="EAV"."START_DATE" OR
"EC"."END_DATE" IS NULL OR "EAV"."END_DATE"<="EC"."END_DATE") OR "EC"."START_DATE">="EAV"."START_DATE" AND ("EC"."END_DATE"
IS NULL AND "EAV"."END_DATE">="EC"."START_DATE" OR "EAV"."END_DATE" IS NULL OR "EC"."END_DATE"<="EAV"."END_DATE"))
61 - access("EC"."EQUIPMENT_ID"="EC"."EQUIPMENT_ID")
62 - access("STOCK_EQUIPMENT"."STOCK_EQUIPMENT_ID"="STOCK_EQUIPMENT_ATTRIB_VALUE"."STOCK_EQUIPMENT_ID")
64 - access("EC"."MODEL_ID"="STOCK_EQUIPMENT"."MODEL_ID")
66 - filter("EC"."END_DATE" IS NULL)
68 - filter("ES"."EQUIPMENT_STATUS_CODE"='AVA')
69 - access("EC"."EQUIPMENT_STATUS_ID"="ES"."EQUIPMENT_STATUS_ID")
71 - filter("EAV"."END_DATE" IS NULL)
73 - access("EC"."LOCATION_ID"="L"."LOCATION_ID")
77 - access("STOCK_EQUIPMENT"."STOCK_EQUIPMENT_ID"=:B1)
78 - access("STOCK_EQUIPMENT"."STOCK_EQUIPMENT_ID"="STOCK_EQUIPMENT_ATTRIB_VALUE"."STOCK_EQUIPMENT_ID")
filter("STOCK_EQUIPMENT_ATTRIB_VALUE"."STOCK_EQUIPMENT_ID"=:B1)
5 minutes reduced to 7 seconds.!!
THE QUESTION.
Which (and where) query hint do I use to get the FIRST query to use the execution plan "method" of the second -
IE: To still perform well when a IN-LIST is used instead of EQUALS.
Technical:
Oracle 10.2.0.2 EE on Solaris 8, 64 bit.
Please help.
Thank you.
Below is the code of the referenced views for clarity.
CREATE OR REPLACE FORCE VIEW etrak.v_stocked_equipment_inven_his (stock_equipment_id,
equipment_id,
model_id,
gameset_id,
gameset_is_active,
game_ware_id,
game_ware_is_active,
equipment_status_code,
ec_start_date,
ec_end_date,
eav_start_date,
eav_end_date,
model_attribute_value_id,
site_id,
is_store
AS
SELECT DISTINCT stock_equipment_id, equipment_id, model_id, gameset_id,
gameset_is_active, game_ware_id, game_ware_is_active,
equipment_status_code, ec_start_date, ec_end_date,
eav_start_date, eav_end_date, model_attribute_value_id,
site_id, is_store
FROM (SELECT stock_equipment_id, equipment_id, model_id,
gameset_id, gameset_is_active, game_ware_id,
game_ware_is_active, equipment_status_code,
ec_start_date, ec_end_date, eav_start_date,
eav_end_date, model_attribute_value_id, site_id,
is_store
FROM (SELECT DISTINCT equipment_id, model_id,
gameset_id, gameset_is_active,
game_ware_id, game_ware_is_active,
equipment_status_code,
model_attribute_value_id,
ec_start_date, ec_end_date,
eav_start_date, eav_end_date,
site_id, is_store
FROM (SELECT ec.equipment_id,
ec.model_id,
gs.gameset_id,
gs.active_flag
AS gameset_is_active,
gw.game_ware_id,
gw.active_flag
AS game_ware_is_active,
es.equipment_status_code,
ec.start_date
AS ec_start_date,
ec.end_date
AS ec_end_date,
l.site_id, st.is_store
FROM equipment_configuration ec,
equipment_status es,
LOCATION l,
site s,
site_type st,
gameset gs,
game_ware gw
WHERE ec.equipment_status_id =
es.equipment_status_id
AND ec.gameset_id = gs.gameset_id(+)
AND gs.game_ware_id = gw.game_ware_id(+)
AND ec.location_id =
l.location_id
AND l.site_id = s.site_id
AND s.site_type_id =
st.site_type_id)
JOIN
(SELECT ec.equipment_id,
model_attribute_value_id,
eav.start_date
AS eav_start_date,
eav.end_date
AS eav_end_date
FROM equipment_configuration ec,
equipment_attribute_value eav
WHERE ec.equipment_id =
eav.equipment_id)
USING (equipment_id)
WHERE ( eav_start_date >=
ec_start_date
AND ( ( eav_end_date IS NULL
AND ec_end_date >=
eav_start_date
OR ec_end_date IS NULL
OR eav_end_date <=
ec_end_date
OR ( ec_start_date >=
eav_start_date
AND ( ( ec_end_date IS NULL
AND eav_end_date >=
ec_start_date
OR eav_end_date IS NULL
OR ec_end_date <=
eav_end_date
JOIN
(SELECT stock_equipment_id, model_id,
model_attribute_value_id
FROM stock_equipment JOIN stock_equipment_attrib_value
USING (stock_equipment_id)
) USING (model_id,
model_attribute_value_id)
CREATE OR REPLACE FORCE VIEW etrak.v_stock_equipment_mod_man_list (stock_equipment_id,
stock_equipment_code,
model_id,
model_name,
model_type_id,
model_type_code,
model_type_name,
man_id,
man_name
AS
SELECT se.stock_equipment_id, se.stock_equipment_code, m.model_id,
m.model_name, mt.model_type_id, mt.model_type_code,
mt.model_type_name, ma.man_id, ma.man_name
FROM stock_equipment se, model m, model_type mt, manufacturer ma
WHERE se.model_id = m.model_id
AND m.model_type_id = mt.model_type_id
AND m.man_id = ma.man_id;

What also makes it difficult to read is the lack of formatting tags ([code][/code] or [pre][/pre]) so that we can actually read the code and execution plans.
I'm not going to trawl through formatting all that myself just to try and see what the differences are between query 1 and query 2.
Also bear in mind that when query 2 ran, the data may have been cached and so there is less physical I/O required.
You don't really want to use any hints to cause re-use of execution plans from 1 query to a different query (like I said, I don't know how different they are). What you want to do is determine what poor SQL coding is making the first query slow and fix it.

Similar Messages

  • Opening Query: u0091BEx transport request '' is not available or not suitable"u0092

    Hello,
    I tried was able to run and modify a query last week. When I try to modify/run it now, it gives the message below and allows me to run it but not modify.
    ‘BEx transport request '' is not available or not suitable"’
    What are the possbile causes and remedies to this problem?
    Thanks in advance.

    dear Amanda,
    here can imply 'copy' since as the result objects(query and elements) in production are exactly same with dev. but the terms 'copy' itself in query normally refer to copy query from one infoprovider to another infoprovider.
    (transaction rszc).
    i think she mean the query objects included in transport request and will be carried on to qa/production server.
    once the new queries 'placed on transport'(in request), we must immediately create a bex request for the same package, otherwise nobody can save their queries (that included in the request).
    transport bex
    http://help.sap.com/saphelp_nw2004s/helpdata/en/38/5ee7377a98c17fe10000009b38f842/frameset.htm
    copy query
    http://help.sap.com/saphelp_bw33/helpdata/en/9f/f57539d6d1c93be10000000a114084/frameset.htm
    hope this helps.

  • Use query hints to build the aggregate views

    can i get a link on this information
    and wherr can i find out about Aggregated design wizard that helps create aggregation scripts
    thanks
    Edited by: Next Level on Jul 8, 2012 6:10 AM

    Try
    Look for Query Hints - http://docs.oracle.com/cd/E17236_01/epm.1112/esb_dbag/alocare.html#alocare1073704
    Probably worth reading
    Aggregating an Aggregate Storage Database - http://docs.oracle.com/cd/E17236_01/epm.1112/esb_dbag/alocare.html#alocare1078558
    EAS documentation
    Query Hints http://docs.oracle.com/cd/E17236_01/epm.1112/eas_help/queryhints.html
    Aggregation Design Wizard - http://docs.oracle.com/cd/E17236_01/epm.1112/eas_help/dbwzagg.html
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • HT201304 Why is it not letting me download free apps on my iPad when ? It's asking for my bank details again and when I type my security number in its says its been declined from a previous purchase? Can u help me pls!

    Why is t not letting me download free apps on my iPad when it's asking for my security number and when I type it in my details on my iCloud account it's saying its been declined and asking for another payment card ? Can some1 help me pls!!

    You will need to contact iTunes support to get that sorted out: http://www.apple.com/support/itunes/contact/

  • I have a problem while typing in my MacBook pro. it is showing different characters when i type. for example: qw`e§r]t[y=   this is how when we type "qwerty|" can anyone help me pls?

    I have a problem while typing in my MacBook pro. it is showing different characters when i type. for example: qw`e§r]t[y=   this is how when we type "qwerty|" can anyone help me pls?

    You could just try changing your Input Sources under System Preferences>Language & Text:
    But I kind of doubt that's going to work. It may be a hardware problem or a system problem. If you take it into Apple they might be able to determine which and might advise a reinstallation of System software. I would take it to an Apple Store or an AASP but, first, make sure that you have a backup just in case they suggest a clean install of the system.
    Good luck,
    Clinton

  • Can anyone help me pls. , I deleted an app on my Ipod Touch, and It was deleted but when I connected my device on my computer and went to iTune "apps" , I saw the app I deleted and it says "install" .  Guys, how will I delete it permanently? Pls help me.

    Can anyone help me pls. , I deleted an app on my Ipod Touch, and It was deleted but when I connected my device on my computer and went to iTunes>"apps" , I still saw the app I deleted and it says "install" .  Guys, how will I delete it permanently? May you Pls help me. Thanks

    Just don't click install

  • HT204291 Im trying to use my apple TV to see a movie from my iphone. Since i select the airplay icon on my phone, i can only hear the voice of the movie on my screen but i cant see the movie, can anybody help me pls? Tks

    Im trying to use my apple TV to see a movie from my iphone. Since i select the airplay icon on my phone, i can only hear the voice of the movie on my screen but i cant see the movie, can anybody help me pls? Tks

    Is this a movie from iTunes? If so is it a rental or one you've purchased?

  • Order by taking too much time. Tried using all_rows hints no use.Pls advice

    I run the query without order by and finishes in less than 30 sec. Once you have order by,query just hangs. Pls advice. Thanks.
    select col4,col6
    from
    table a , table b, table c
    where a.col1 = b.col2
    and a.col1 = c.col3
    order by col1,col2 desc

    If you put the \ tag (6 characters, all lower case) around the text where you want to preserve the formatting, the query plans you post are going to be much more readable.
    The optimizer's estimates appear to be correct and the plan is the same other than the ORDER BY.  I would, therefore, be highly inclined to believe as I was discussing earlier that the "30 seconds" figure that you're discussing is the time to fetch the first few rows, not the time to fetch the last row.
    Can you define "hang"?  How long do you let the query run before killing it?  Minutes?  Hours?  Days?
    What are the wait events associated with the query when it is running?  If the optimizer is correct that you're generating 5.4 million rows and a little over a GB of data that needs to be sorted, that should be expensive but that shouldn't take hours.
    What is the business problem you're trying to solve?  Sorting implies that you are trying to return results from a report to a user.  But, obviously, no user is ever going to page through 5.4 million rows of results.
    Justin                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Query hint to force SQL to use a temporary table in a CTE query?

    Hi,
    is it possible to tell SQL Server to create a temporary table by itself when I'm using a CTE in my query?
    I have a query starting with a CTE where I group by my record, then another recursive CTE use the first CTE and finally my select statement like:
    with cte as (select a,b,c,row_number() ...  from mytable group by a,b,c)
    , cte2(select .... from cte A where rownum =1
    union all select ... from cte B inner join cte2 C on ......
    select * from cte2
    this query is very very slow, but if I store the first CTE into a temporary table and then cte2 consume my temp table rather than the CTE, the query is very fast.
    creating the temp table took 10sec and the select took 20sec
    while the initial query didnt return anything  after 2minutes!!!
    so what can I try to do to have the query running in less than 30sec without creating the temp table first?
    is there a query hint which can be used to tell SQL Server to convert the CTE into a temp table?
    as I have a lot of query to manage, I want to simplify my model without relying in temporary tables every time I suffer this issue...
    thanks.

    What is your SQL Server version?
    There is no hint to materialize results of cte into a temp table, so the solution you tried is the best you can have.
    I think the idea of materializing CTE into a temp table was already proposed on Connect. Try searching for this and vote.
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • How to improve the performance of the attached query, Please help

    Hi,
    How to improve performance of the below query, Please help. also attached explain plan -
    SELECT Camp.Id,
    rCam.AccountKey,
    Camp.Id,
    CamBilling.Cpm,
    CamBilling.Cpc,
    CamBilling.FlatRate,
    Camp.CampaignKey,
    Camp.AccountKey,
    CamBilling.billoncontractedamount,
    (SUM(rCam.Impressions) * 0.001 + SUM(rCam.Clickthrus)) AS GR,
    rCam.AccountKey as AccountKey
    FROM Campaign Camp, rCamSit rCam, CamBilling, Site xSite
    WHERE Camp.AccountKey = rCam.AccountKey
    AND Camp.AvCampaignKey = rCam.AvCampaignKey
    AND Camp.AccountKey = CamBilling.AccountKey
    AND Camp.CampaignKey = CamBilling.CampaignKey
    AND rCam.AccountKey = xSite.AccountKey
    AND rCam.AvSiteKey = xSite.AvSiteKey
    AND rCam.RmWhen BETWEEN to_date('01-01-2009', 'DD-MM-YYYY') and
    to_date('01-01-2011', 'DD-MM-YYYY')
    GROUP By rCam.AccountKey,
    Camp.Id,
    CamBilling.Cpm,
    CamBilling.Cpc,
    CamBilling.FlatRate,
    Camp.CampaignKey,
    Camp.AccountKey,
    CamBilling.billoncontractedamount
    Explain Plan :-
    Description                    Object_owner          Object_name     Cost     Cardinality     Bytes     
    SELECT STATEMENT, GOAL = ALL_ROWS                              14     1     13
    SORT AGGREGATE                                                  1     13
    VIEW                         GEMINI_REPORTING               14     1     13
    HASH GROUP BY                                        14     1     103
    NESTED LOOPS                                        13     1     103
    HASH JOIN                                             12     1     85
    TABLE ACCESS BY INDEX ROWID     GEMINI_REPORTING     RCAMSIT          2     4     100
    NESTED LOOPS                                        9     5     325
    HASH JOIN                                        7     1     40
    SORT UNIQUE                                        2     1     18
    TABLE ACCESS BY INDEX ROWID     GEMINI_PRIMARY          SITE          2     1     18
    INDEX RANGE SCAN          GEMINI_PRIMARY          SITE_I0          1     1     
    TABLE ACCESS FULL          GEMINI_PRIMARY          SITE          3     27     594
    INDEX RANGE SCAN          GEMINI_REPORTING     RCAMSIT_I     1     1     5     
    TABLE ACCESS FULL     GEMINI_PRIMARY     CAMPAIGN                    3     127     2540
    TABLE ACCESS BY INDEX ROWID     GEMINI_PRIMARY          CAMBILLING     1     1     18
    INDEX UNIQUE SCAN     GEMINI_PRIMARY     CAMBILLING_U1                    0     1

    Hello,
    This has really nothing to do with the Oracle Forms product.
    Please, send the SQL or/and PL/SQL questions in the corresponding forums.
    Francois

  • "SQL Query in HTTP Request" (5474:0)

    Hi,
    The IDS signature "SQL Query in HTTP Request" (5474:0) does not recognize all malicious SQL selects. Currently, the reg exp looks like [%]20|[=]|[+])[Ss][Ee][Ll][Ee][Cc][Tt]([%]20|[+])[^\r\n\x00-\x19\x7F-\xFF]+([%]20|[+])[Ff][Rr][Oo][Mm]([%]20|[+] . We noticed that subselects does not trigger the signature. For example, "...(select%20something%20from%20somethingmore%20where%20variable%20=%20(select%20....." which could be malicious. Is there any possibility to include "(" in the regexp to detect subselects?
    Regards,
    /Ola

    hmmm...That should actually match just fine. Let's break it down:
    ([%]20|[=]|[+]) <--"%20","=",or "+"
    [Ss][Ee][Ll][Ee][Cc][Tt] <-- "SELECT"
    ([%]20|[+]) <--"%20" or "+"
    [^\r\n\x00-\x19\x7F-\xFF]+ <-- NOT one or more ascii control or extended chars
    ([%]20|[+]) <-- "%20" or "+"
    [Ff][Rr][Oo][Mm] <-- "FROM"
    ([%]20|[+]) <-- "%20" or "+"
    The only reason I can think that it wouldn't match is if there some funky characters between the first SELECT and the first FROM (i.e. carriage return/line feed, etc). Also remember that a %20 or = or + must precede the SELECT and that a %20 or + must follow the FROM.

  • Oracle query hints in JPQL - is it possible?

    Sorry, posted to wrong forum... I don't know how to delete it - only edit...
    Hello,
    I am using Sun Java Application Server 9.1 (GlassFish), EJB 3.0 and JPA (TopLink). My database is Oracle.
    Is there any way to specify Oracle query hints (for example, /*+ rule */ in JPQL queries? Or the only way to do it is using native queries?
    Many thanks in advance
    Edited by: Troff_2 on Nov 27, 2007 5:50 AM

    Yes.It is possible.Only need to modify the view for order tracker query need to change.
    You can use decode statement in the query to add status as Processing .
    Please refer the IBE_ORDER_SUM_V view for details.
    Eg:
    decode(oel.meaning,'Booked',"Processing",oel.meaning) from
    oe_lookups        
    oel,

  • AT selection-screen on ON HELP-REQUEST

    Hi
    What is normally done in the Selection Screen event :
    AT selection-screen on ON HELP-REQUEST.
    Normally pressing F1 helps gives Documentation present in Data Element assoicated with the field. Exactly in what cases would we be needing to use this event.

    Hi,
    That event is used for search.
    at selection-screen on value-request for p_file.
      call function 'F4_FILENAME'
           exporting
                field_name = 'p_file'
           importing
                file_name  = p_file.
    If you code in the same manner in the selection screen you will able to search and select a file from your work station, so that it will be uploaded in SAP.
    I hope this will help you, if not plzzz be back.
    CHEERS
    If your problem is solved award points and close the thread.

  • PROCESS ON HELP-REQUEST

    Hi
    wat is importance of POH. what If there is no PROCESS ON HELP-REQUEST ?
    Thanks and regards
    - Puneet Sharma.

    To display data element supplement documentation, you must code the following screen flow logic in the POH event:
    PROCESS ON HELP-REQUEST.
      FIELD <f> [MODULE <mod>] WITH <num>.
    After PROCESS ON HELP-REQUEST, you can only use FIELD statements. If there is no PROCESS ON HELP-REQUEST keyword in the flow logic of the screen, the data element documentation for the current field, or no help at all is displayed when the user chooses F1. Otherwise, the next FIELD statement containing the current field <f> is executed.
    If there is screen-specific data element supplement documentation for the field <f>, you can display it by specifying its number <num>. The number <num> can be a literal or a variable. The variable must be declared and filled in the corresponding ABAP program.
    You can fill the variables, for example, by calling the module <mod> before the help is displayed. However, the FIELD statement does not transport the contents of the screen field <f> to the ABAP program in the PROCESS ON HELP-REQUEST event.

  • Somebody help me. pls.

    I'm beginner on FCP.
    and I captured from my HDV and try to edit.
    but,
    viewer is strange.
    every frame in viewer is white(blank) and sometimes marked "X"
    it is normally displayed only when 'play'
    In single frame, jogging and shuttling, reverse playing, it just blank,
    (when jogging, sound is hearing)
    but point it and move to timeline, I can see every single frame.
    I already know HDV is long GOP mpeg2 and so it is hard to en/decode.
    but I think my case is abnormal.
    somebody help me, pls.

    but,
    viewer is strange.
    every frame in viewer is white(blank) and sometimes marked "X"
    it is normally displayed only when 'play'
    In single frame, jogging and shuttling, reverse playing, it just blank,
    (when jogging, sound is hearing)
    but point it and move to timeline, I can see every single frame.<
    Welcome to the family. Sorry I do not understand your language, I only know English.
    Check the Canvas View controls to see if you have set it to ALPHA.
    bogiesan

Maybe you are looking for

  • History report page prints before printing each new document?cc=us

    How do i stop my HP Officejet 6700  Premium from printing a history report page before printing each new document, using Windows 7 & Using Microsoft Word? When I open a document and print it, it prints a history including: File Name; Directory; Templ

  • How do I reinstall pages on my new hard drive

    I have just replaced my hard drive in my macbook pro. How do I reinstall pages and numbers without paying for it

  • What is the Relation between SAP EP, SAP R/3 and any database

    Hi ALL, I am learning SAP EP,Webdynpro Previously I have worked on IBM WebSphere Portal for installation and configuration test purpose on different operating systems. In case of IBM webSphere Portal 1. There is a default database named as Cloudspace

  • Why can't I label folders-Mac OS X 10.6.8

    lately I have been having problems with labeling folders (Finder>File>Label). I am using Snow Leopard - does any one have any tips? I also can't drop folders into other folders (I get a ø sign)

  • Open parameters multiple pdf search

    using the command line, Is there a way to do an advanced search of multiple pdf files, I know that I can search the file I opened for text using: path_to_acrobat /A search="Search term" path_to_pdf Im just wondering if this search can be modified to