10g query running faster with RBO than CBO
I am running a query in Oracle 10g that is taking 1minute 15 seconds to run using the CBO. All the tables and indexes in the query are fully analyzed. However if i add a /*+ Rule */ hint to the query and force the optimizer to RBO it runs in 5 seconds.
Anyone any ideas why this would occur? it's contrary to everything Oracle says about CBO and problematic as RBO is no longer supported in 10g
Any help / advice greatfully appreciated
Thanks
Declan
My "best" CBO explain plan is......
Explain complete.
Elapsed: 00:00:01:90
PLAN_TABLE_OUTPUT
| Id | Operation | Name | Rows | Bytes |TempSpc| Cost |
| 0 | SELECT STATEMENT | | 3364K| 2553M| | 666K|
| 1 | SORT ORDER BY | | 3364K| 2553M| 5840M| 666K|
| 2 | VIEW | | 3364K| 2553M| | 273K|
| 3 | UNION-ALL | | | | | |
|* 4 | HASH JOIN | | 2269K| 1415M| | 255K|
|* 5 | TABLE ACCESS FULL | NODE | 6 | 198 | | 183 |
|* 6 | HASH JOIN OUTER | | 2269K| 1344M| | 255K|
|* 7 | HASH JOIN | | 710 | 266K| | 2179 |
|* 8 | HASH JOIN OUTER | | 1219 | 165K| | 355 |
|* 9 | HASH JOIN | | 1219 | 154K| | 318 |
|* 10 | HASH JOIN | | 1219 | 138K| | 260 |
|* 11 | HASH JOIN | | 1219 | 127K| | 224 |
| 12 | TABLE ACCESS FULL | TMP_NODE_WALK_ALL_NODES | 8168 | 311K| | 17 |
|* 13 | HASH JOIN | | 10896 | 723K| | 201 |
| 14 | INDEX FAST FULL SCAN | PK_NODE_RULES_NODE_ID_RULE_ID | 10896 | 106K| | 6 |
| 15 | TABLE ACCESS FULL | NODE | 73004 | 4134K| | 183 |
| 16 | INDEX FAST FULL SCAN | IDX_NODE_CIX2 | 73004 | 641K| | 33 |
PLAN_TABLE_OUTPUT
| 17 | INDEX FAST FULL SCAN | IDX_NODE_CIX1 | 73004 | 998K| | 54 |
| 18 | INDEX FAST FULL SCAN | IDX_NODE_CIX2 | 73004 | 641K| | 33 |
|* 19 | TABLE ACCESS FULL | RULES | 6344 | 1517K| | 1820 |
| 20 | VIEW | | 405M| 89G| | 43581 |
|* 21 | HASH JOIN OUTER | | 405M| 23G| | 43581 |
| 22 | TABLE ACCESS FULL | TMP_NODE_WALK_ALL_NODES | 8168 | 103K| | 17 |
| 23 | TABLE ACCESS FULL | UNIVERSAL_RULES | 3377K| 157M| | 43256 |
|* 24 | HASH JOIN OUTER | | 1094K| 410M| 148M| 17453 |
| 25 | MERGE JOIN CARTESIAN | | 390K| 143M| | 15029 |
| 26 | NESTED LOOPS | | 70 | 25060 | | 2849 |
| 27 | NESTED LOOPS | | 70 | 21000 | | 2779 |
| 28 | TABLE ACCESS BY INDEX ROWID| UNIVERSAL_RULES | 1392 | 76560 | | 1387 |
|* 29 | INDEX RANGE SCAN | IDX_UNIVERSAL_RULES_ACCOUNT | 1392 | | | 6 |
|* 30 | TABLE ACCESS BY INDEX ROWID| RULES | 1 | 245 | | 1 |
|* 31 | INDEX UNIQUE SCAN | PK_RULES_RULE_ID_VERSION_ID | 20 | | | |
|* 32 | TABLE ACCESS BY INDEX ROWID | NODE | 1 | 58 | | 1 |
|* 33 | INDEX UNIQUE SCAN | PK_NODE_NODE_ID | 6 | | | |
| 34 | BUFFER SORT | | 5616 | 153K| | 15028 |
| 35 | TABLE ACCESS BY INDEX ROWID | NODE | 5616 | 153K| | 174 |
|* 36 | INDEX RANGE SCAN | IDX_NODE_NODE_TYPE_ID | 5616 | | | 11 |
|* 37 | INDEX FAST FULL SCAN | IDX_RULES_RULE_ID_STATUS | 42293 | 289K| | 48 |
PLAN_TABLE_OUTPUT
Predicate Information (identified by operation id):
4 - access("NODE"."NODE_TYPE_ID"="SN"."HIERARCHY_TYPE_ID")
5 - filter("NODE"."PARENT_NODE_ID" IS NULL)
6 - access("SYS_ALIAS_1"."RULE_ID"="UR"."RULE_ID"(+) AND "SYS_ALIAS_1"."VERSION_ID"="UR"."VERSION_ID"(+))
7 - access("NR"."RULE_ID"="SYS_ALIAS_1"."COMBINED_RULE_ID")
8 - access("SN"."PARENT_NODE_ID"="SP"."NODE_ID"(+))
9 - access("AN"."START_NODE_ID"="SN"."NODE_ID")
10 - access("AN"."EFFECTIVE_NODE_ID"="EN"."NODE_ID")
11 - access("AN"."SHORTCUT_NODE_ID"="N"."NODE_ID")
13 - access("N"."NODE_ID"="NR"."NODE_ID")
19 - filter(',A,P,' LIKE '%,'||"SYS_ALIAS_1"."STATUS"||',%')
21 - access("UR"."NODE_ID"(+)="AN"."START_NODE_ID")
24 - access("R"."RULE_ID"="RP"."RULE_ID"(+))
29 - access("UR"."ACCOUNT_ID"='0069')
30 - filter(',A,P,' LIKE '%,'||"R"."STATUS"||',%')
31 - access("UR"."RULE_ID"="R"."RULE_ID" AND "UR"."VERSION_ID"="R"."VERSION_ID")
32 - filter("N"."HIERARCHY_TYPE_ID"=9)
PLAN_TABLE_OUTPUT
33 - access("UR"."NODE_ID"="N"."NODE_ID")
36 - access("NODE"."NODE_TYPE_ID"=9)
37 - filter("RP"."STATUS"(+)='P')
Note: cpu costing is off
28 rows selected.
Elapsed: 00:00:02:45
68 rows selected.
Elapsed: 00:00:05:76While my RBO explain plan is
Explain complete.
Elapsed: 00:00:01:23
PLAN_TABLE_OUTPUT
| Id | Operation | Name | Rows | Bytes | Cost |
| 0 | SELECT STATEMENT | | | | |
| 1 | SORT ORDER BY | | | | |
| 2 | VIEW | | | | |
| 3 | UNION-ALL | | | | |
| 4 | MERGE JOIN OUTER | | | | |
| 5 | SORT JOIN | | | | |
|* 6 | TABLE ACCESS BY INDEX ROWID | NODE | | | |
| 7 | NESTED LOOPS | | | | |
| 8 | NESTED LOOPS | | | | |
| 9 | NESTED LOOPS | | | | |
| 10 | NESTED LOOPS | | | | |
| 11 | NESTED LOOPS | | | | |
| 12 | NESTED LOOPS OUTER | | | | |
| 13 | NESTED LOOPS | | | | |
| 14 | TABLE ACCESS FULL | TMP_NODE_WALK_ALL_NODES | | | |
| 15 | TABLE ACCESS BY INDEX ROWID| NODE | | | |
|* 16 | INDEX UNIQUE SCAN | PK_NODE_NODE_ID | | | |
PLAN_TABLE_OUTPUT
| 17 | TABLE ACCESS BY INDEX ROWID | NODE | | | |
|* 18 | INDEX UNIQUE SCAN | PK_NODE_NODE_ID | | | |
| 19 | TABLE ACCESS BY INDEX ROWID | NODE | | | |
|* 20 | INDEX UNIQUE SCAN | PK_NODE_NODE_ID | | | |
| 21 | TABLE ACCESS BY INDEX ROWID | NODE | | | |
|* 22 | INDEX UNIQUE SCAN | PK_NODE_NODE_ID | | | |
| 23 | TABLE ACCESS BY INDEX ROWID | NODE_RULES | | | |
|* 24 | INDEX RANGE SCAN | IDX_NODE_RULES_NODE_ID | | | |
|* 25 | TABLE ACCESS BY INDEX ROWID | RULES | | | |
|* 26 | INDEX RANGE SCAN | IDX_RULES_COMBINED_RULE_ID | | | |
|* 27 | INDEX RANGE SCAN | IDX_NODE_NODE_TYPE_ID | | | |
|* 28 | SORT JOIN | | | | |
| 29 | VIEW | | | | |
| 30 | NESTED LOOPS OUTER | | | | |
| 31 | TABLE ACCESS FULL | TMP_NODE_WALK_ALL_NODES | | | |
| 32 | TABLE ACCESS BY INDEX ROWID | UNIVERSAL_RULES | | | |
|* 33 | INDEX RANGE SCAN | IDX_UNIVERSAL_RULES_NODE | | | |
| 34 | NESTED LOOPS OUTER | | | | |
| 35 | NESTED LOOPS | | | | |
| 36 | NESTED LOOPS | | | | |
| 37 | NESTED LOOPS | | | | |
PLAN_TABLE_OUTPUT
| 38 | TABLE ACCESS BY INDEX ROWID | NODE | | | |
|* 39 | INDEX RANGE SCAN | IDX_NODE_NODE_TYPE_ID | | | |
| 40 | TABLE ACCESS BY INDEX ROWID | UNIVERSAL_RULES | | | |
|* 41 | INDEX RANGE SCAN | IDX_UNIVERSAL_RULES_ACCOUNT | | | |
|* 42 | TABLE ACCESS BY INDEX ROWID | NODE | | | |
|* 43 | INDEX UNIQUE SCAN | PK_NODE_NODE_ID | | | |
|* 44 | TABLE ACCESS BY INDEX ROWID | RULES | | | |
|* 45 | INDEX UNIQUE SCAN | PK_RULES_RULE_ID_VERSION_ID | | | |
|* 46 | INDEX RANGE SCAN | IDX_RULES_RULE_ID_STATUS | | | |
Predicate Information (identified by operation id):
6 - filter("NODE"."PARENT_NODE_ID" IS NULL)
16 - access("AN"."START_NODE_ID"="SN"."NODE_ID")
18 - access("SN"."PARENT_NODE_ID"="SP"."NODE_ID"(+))
20 - access("AN"."EFFECTIVE_NODE_ID"="EN"."NODE_ID")
22 - access("AN"."SHORTCUT_NODE_ID"="N"."NODE_ID")
24 - access("N"."NODE_ID"="NR"."NODE_ID")
25 - filter(',A,P,' LIKE '%,'||"SYS_ALIAS_1"."STATUS"||',%')
PLAN_TABLE_OUTPUT
26 - access("NR"."RULE_ID"="SYS_ALIAS_1"."COMBINED_RULE_ID")
27 - access("NODE"."NODE_TYPE_ID"="SN"."HIERARCHY_TYPE_ID")
28 - access("SYS_ALIAS_1"."RULE_ID"="UR"."RULE_ID"(+))
filter("SYS_ALIAS_1"."VERSION_ID"="UR"."VERSION_ID"(+) AND
"SYS_ALIAS_1"."RULE_ID"="UR"."RULE_ID"(+))
33 - access("UR"."NODE_ID"(+)="AN"."START_NODE_ID")
39 - access("NODE"."NODE_TYPE_ID"=9)
41 - access("UR"."ACCOUNT_ID"='0069')
42 - filter("N"."HIERARCHY_TYPE_ID"=9)
43 - access("UR"."NODE_ID"="N"."NODE_ID")
44 - filter(',A,P,' LIKE '%,'||"R"."STATUS"||',%')
45 - access("UR"."RULE_ID"="R"."RULE_ID" AND "UR"."VERSION_ID"="R"."VERSION_ID")
46 - access("R"."RULE_ID"="RP"."RULE_ID"(+) AND "RP"."STATUS"(+)='P')
Note: rule based optimization
28 rows selected.
Elapsed: 00:00:04:42
78 rows selected.
Elapsed: 00:00:08:86Any additional help appreciated
I am going to try and run a trace against the sql now and see if i can get any more information
Thanks in advance
Declan
Similar Messages
-
Does SQL Query run faster with/without Conditions....
Hi All, forgive my novice question.
Was just wondering" In general if we run a SQL query on a single table; does my query run faster if there are multiple where conditions? or without. What happens if the conditions increase? My table is a big one with 5 million rows and some bitmap indexes defined on it.
Thanks,
KonI think it's difficult to give general rule because there are too much dependencies on the fact that the columns are indexed or not, on the way tables and indexes statistics are computed or not, on the possible session or instance parameters that the optimizer may use, on the Oracle version, etc.
Message was edited by:
Pierre Forstmann -
Hi Gurus,
We are using Report 10g on 10g Application server and solaris. we created a report on a table which has 10,000 rows. The report has 25 columns. when we run this query in Toad it took 12 sec for fetching all these 10,000 rows
But when we run the report with Destype = 'FILE' and Desformat = 'DELIMITEDDDATA', it is taking 5 to 8 minutes
to open in excel ( we concatenated mimetype=vnd-msexcel at the end of the url if the Destype=FILE). We removed the layout in the report as it is taking 10 to 15 mins to run to Screen with Desformat=HTML/PDF(formating pages taking more time). We are wondering why DELIMITEDDATA format is taking long time as it runs only query.
Does RWSERVLET take more time of writing the data to the Physical file in the cache dir? Our cache size is 1 GB. we have 2 report servers clustered. Tracing is off.
Please advise me if there are any report server settings to boost the performance.
Thanks alot,
Ram.Duplicate of Strange problem... Query runs faster, but report runs slow... in the Reports forum.
[Thread closed] -
What are the ways to make Query run fast?
Hi Experts,
When a query runs slow, we generally go for creating an aggregate. My doubt is - what other things can be done to make a query run faster before creating an aggregate? What is the thumb rule to be carried out for creating an aggregate?
Regards,
ShreeemHi Shreem,
If you keep Query simple not complicate it with runtime calculations , it would be smooth. However as per business requirements we will have to go for it anyways mostly.
regarding aggregates:
Please do not use the standard proposal , it will give you hundreds based on std. rules , which consumes lots of space and adds up to load times. If you have users already using the Query and you are planning to tune it then go for the statistics tables:
1.RSDDSTAT_OLAP find the query with long runtimes get the Stepuid
2. RSDDSTAT_DM
3. RSDDSTATAGGRDEF - use the stepuid above to see which aggregate is necessary for which cube.
Another way to check ; check the users as in 1 to find the highest runtime users and find the last used bookmarks by user thru RSZWBOOKMARK for this query and check if the time matches and create the aggregates as in 3 above.
You can also Use Transaction RSRT > execute & debug (display stats ) - to create generic aggregates to support navigations for New queries and later refine as above.
Hope it helps .
Thnks
Ram -
Any settings that can be adjusted to make everything run faster with Mountain Lion
Hello,
Does anyone know of any settings or adjustments that can be tweeked to make my machine run faster with Mountain Lion?
Thanks, Jasonyes you can do it yourself - it's actually a simple upgrade - i use a ssd in my macbook and have the RAM maxed out to 16GB.
as for what brands should you consider, here are some good ones.
Sandisk Extreme - Currently the fastest one out there.
Kingston HyperX - Second fastest - this is what I have in my 13 Inch Late 2011.
Samsung 830 series - Fast and uses less battery power - this is what's installed in the Macbook Retina.
Crucial M4 - Also a fast SSD - I have the 512GB installed in my 15 inch Late 2011.
If you decide to install one of these ssd in your Macbook - let me know if you need a step by step on how to clone your drive.
Good luck.. -
Query runs faster when there is no statistics
Hi Gurus
I have a Oracle 10.2.0.1 instance and I'm seeing the following weird behavior, I appreciate any pointers or references to resolve this problem.
Thank you very much.
1. Run the below mentioned query for 10 times continuously from sqlplus. Elapsed time is around 115 seconds (around 2
min) for each execution. Elapsed time is constant, no increase or decrease. Tables involved in the query have statistics with 100% sampling.
2. delete the statistics on 2 tables involved in query. Flush the shared_pool
(alter system flush shared_pool).
3. Run the query for 10 times. Elapsed time is less than 2 seconds for each execution. Elapsed time is constant, no
increase or decrease.
The Query: (it is a generated query, no option for modifying it).
select count(distinct itm1.itm_id) FROM ita ita1, ita ita2, itm itm1, itm itm2, itm itm3
where itm1.itm_container_id = 2812
and itm1.itm_version_id <= 999999999
and itm1.itm_next_version_id >= 999999999
and itm2.itm_primary_key = 'RAYBESTOS'
and itm3.itm_primary_key = '1'
and ita1.ita_node_id = 3111
and itm2.itm_container_id = 2020
and ita1.ita_item_id = itm1.itm_id
and ita1.ita_version_id <= 999999999
and ita1.ita_next_version_id >= 999999999
and itm2.itm_id = ita1.ita_value_numeric
and itm2.itm_version_id <= 999999999
and itm2.itm_next_version_id >= 999999999
and ita2.ita_node_id = 3118
and itm3.itm_container_id = 2025
and ita2.ita_item_id = itm1.itm_id
and ita2.ita_version_id <= 999999999
and ita2.ita_next_version_id >= 999999999
and itm3.itm_id = ita2.ita_value_numeric
and itm3.itm_version_id <= 999999999
and itm3.itm_next_version_id >= 999999999;
Query uses dynamic sampling when there is no statistics.
tkprof report shows there is a small difference in execution plan between 2 cases. When there is no statistics, there is table access by index rowid. It may be the reason for faster response time.
Rows Row Source Operation
1 SORT GROUP BY (cr=47235 pr=0 pw=0 time=919461 us)
758 {color:#ff0000}TABLE ACCESS BY INDEX ROWID TCTG_ITA_ITEM_ATTRIBUTES (cr=47235 pr=0 pw=0 time=600473 us){color}
14163 NESTED LOOPS (cr=40652 pr=0 pw=0 time=299694 us)
7081 NESTED LOOPS (cr=25708 pr=0 pw=0 time=538463 us)
12771 NESTED LOOPS (cr=90 pr=0 pw=0 time=255699 us)
1 MERGE JOIN CARTESIAN (cr=6 pr=0 pw=0 time=271 us)
1 INDEX RANGE SCAN ICTG_ITM_1 (cr=3 pr=0 pw=0 time=74 us)(object id 105409)
1 BUFFER SORT (cr=3 pr=0 pw=0 time=112 us)
1 INDEX RANGE SCAN ICTG_ITM_1 (cr=3 pr=0 pw=0 time=43 us)(object id 105409)
12771 INDEX RANGE SCAN ICTG_ITA_1 (cr=84 pr=0 pw=0 time=102210 us)(object id 105399)
7081 INDEX RANGE SCAN ICTG_ITM_0 (cr=25618 pr=0 pw=0 time=363715 us)(object id 105408)
7081 INDEX RANGE SCAN ICTG_ITA_0 (cr=14944 pr=0 pw=0 time=239803 us)(object id 105398)Hi Jonathan,
Thanks again for your response. Yes, you are correct. Most of the rows have all 9s, and a small percentage have something else - and there are only a small number of distinct values.
Here is the histogram info when there is statistics (some old data have been trimmed for this test).
TABLE_NAME COLUMN_NAME NUM_DISTINCT NUM_BUCKETS HISTOGRAM
TCTG_ITA_ITEM_ATTRIBUTES ITA_COMPANY_ID 2 2FREQUENCY
TCTG_ITA_ITEM_ATTRIBUTES ITA_CATALOG_ID 62 62FREQUENCY
TCTG_ITA_ITEM_ATTRIBUTES ITA_ITEM_ID 720867 1NONE
TCTG_ITA_ITEM_ATTRIBUTES ITA_NODE_ID 118 118FREQUENCY
TCTG_ITA_ITEM_ATTRIBUTES ITA_VALUE_NUMERIC 587504 254HEIGHT BALANCED
TCTG_ITA_ITEM_ATTRIBUTES ITA_VALUE_STRING 1060930 254HEIGHT BALANCED
TCTG_ITA_ITEM_ATTRIBUTES ITA_VERSION_ID 48 48FREQUENCY
TCTG_ITA_ITEM_ATTRIBUTES ITA_NEXT_VERSION_ID 1 1FREQUENCY
TCTG_ITA_ITEM_ATTRIBUTES ITA_OCCURRENCE_ID 16250 254HEIGHT BALANCED
TCTG_ITA_ITEM_ATTRIBUTES ITA_VALUE_STRING_IGNORECASE 1498257 254HEIGHT BALANCED
TCTG_ITM_ITEM ITM_COMPANY_ID 2 2FREQUENCY
TCTG_ITM_ITEM ITM_ID 720867 1NONE
TCTG_ITM_ITEM ITM_CONTAINER_ID 62 62FREQUENCY
TCTG_ITM_ITEM ITM_PRIMARY_KEY 531960 1NONE
TCTG_ITM_ITEM ITM_VERSION_ID 48 48FREQUENCY
TCTG_ITM_ITEM ITM_NEXT_VERSION_ID 1 1FREQUENCY
TCTG_ITM_ITEM ITM_STATUS 3 1NONE
TCTG_ITM_ITEM ITM_COLLAB_INFO 7 1NONE
TCTG_ITM_ITEM ITM_LAST_MODIFIED 717098 1NONEdisplay_cursor without statistics
SQL> @disp-cursor
756
Elapsed: 00:00:03.81
SQL_ID d9q6j48ns19zv, child number 0
select /*+ gather_plan_statistics */ count(distinct itm1.itm_id) FROM ita ita1, ita ita2, itm itm1, itm itm2, itm itm3 where
itm1.itm_container_id = 2812 and itm1.itm_version_id <= 999999999 and itm1.itm_next_version_id >= 999999999 and
itm2.itm_primary_key = 'RAYBESTOS' and itm3.itm_primary_key = '1' and ita1.ita_node_id = 3111 and
itm2.itm_container_id = 2020 and ita1.ita_item_id = itm1.itm_id and ita1.ita_version_id <= 999999999 and
ita1.ita_next_version_id >= 999999999 and itm2.itm_id = ita1.ita_value_numeric and itm2.itm_version_id <= 999999999
and itm2.itm_next_version_id >= 999999999 and ita2.ita_node_id = 3118 and itm3.itm_container_id = 2025 and
ita2.ita_item_id = itm1.itm_id and ita2.ita_version_id <= 999999999 and ita2.ita_next_version_id >= 999999999 and
itm3.itm_id = ita2.ita_value_numeric and itm3.itm_version_id <= 999999999 and itm3.itm_next_version_id >= 999999999
Plan hash value: 2184662757
| Id | Operation | Name | Starts | E-Rows | A-Rows | A-Time | Buffers | OMem | 1Mem | Used-Mem |
| 1 | SORT GROUP BY | | 1 | 1 | 1 |00:00:03.61 | 178K| 73728 | 73728 | |
|* 2 | TABLE ACCESS BY INDEX ROWID| TCTG_ITA_ITEM_ATTRIBUTES | 1 | 1 | 756 |00:00:00.96 | 178K| | | |
| 3 | NESTED LOOPS | | 1 | 1 | 69879 |00:00:01.27 | 145K| | | |
| 4 | NESTED LOOPS | | 1 | 1 | 34939 |00:00:02.66 | 71815 | | | |
| 5 | NESTED LOOPS | | 1 | 1 | 35695 |00:00:00.71 | 229 | | | |
| 6 | MERGE JOIN CARTESIAN | | 1 | 1 | 1 |00:00:00.01 | 6 | | | |
|* 7 | INDEX RANGE SCAN | ICTG_ITM_1 | 1 | 1 | 1 |00:00:00.01 | 3 | | | |
| 8 | BUFFER SORT | | 1 | 1 | 1 |00:00:00.01 | 3 | 73728 | 73728 | |
|* 9 | INDEX RANGE SCAN | ICTG_ITM_1 | 1 | 1 | 1 |00:00:00.01 | 3 | | | |
|* 10 | INDEX RANGE SCAN | ICTG_ITA_1 | 1 | 1 | 35695 |00:00:00.29 | 223 | | | |
|* 11 | INDEX RANGE SCAN | ICTG_ITM_0 | 35695 | 1 | 34939 |00:00:01.14 | 71586 | | | |
|* 12 | INDEX RANGE SCAN | ICTG_ITA_0 | 34939 | 1 | 34939 |00:00:01.20 | 73590 | | | |
Predicate Information (identified by operation id):
2 - filter("ITM3"."ITM_ID"="ITA2"."ITA_VALUE_NUMERIC")
7 - access("ITM2"."ITM_PRIMARY_KEY"='RAYBESTOS' AND "ITM2"."ITM_CONTAINER_ID"=2020 AND "ITM2"."ITM_NEXT_VERSION_ID">=999999999 AND
"ITM2"."ITM_VERSION_ID"<=999999999)
filter("ITM2"."ITM_VERSION_ID"<=999999999)
9 - access("ITM3"."ITM_PRIMARY_KEY"='1' AND "ITM3"."ITM_CONTAINER_ID"=2025 AND "ITM3"."ITM_NEXT_VERSION_ID">=999999999 AND
"ITM3"."ITM_VERSION_ID"<=999999999)
filter("ITM3"."ITM_VERSION_ID"<=999999999)
10 - access("ITA1"."ITA_NODE_ID"=3111 AND "ITM2"."ITM_ID"="ITA1"."ITA_VALUE_NUMERIC" AND "ITA1"."ITA_NEXT_VERSION_ID">=999999999
AND "ITA1"."ITA_VERSION_ID"<=999999999)
filter("ITA1"."ITA_VERSION_ID"<=999999999)
11 - access("ITA1"."ITA_ITEM_ID"="ITM1"."ITM_ID" AND "ITM1"."ITM_NEXT_VERSION_ID">=999999999 AND "ITM1"."ITM_CONTAINER_ID"=2812 AND
"ITM1"."ITM_VERSION_ID"<=999999999)
filter(("ITM1"."ITM_CONTAINER_ID"=2812 AND "ITM1"."ITM_VERSION_ID"<=999999999))
12 - access("ITA2"."ITA_ITEM_ID"="ITM1"."ITM_ID" AND "ITA2"."ITA_NEXT_VERSION_ID">=999999999 AND "ITA2"."ITA_NODE_ID"=3118 AND
"ITA2"."ITA_VERSION_ID"<=999999999)
filter(("ITA2"."ITA_NODE_ID"=3118 AND "ITA2"."ITA_VERSION_ID"<=999999999))
Note
- dynamic sampling used for this statement
54 rows selected.
Elapsed: 00:00:00.04Display_cursor with statistics
SQL> @disp-cursor
756
Elapsed: 00:01:57.53
SQL_ID d9q6j48ns19zv, child number 0
select /*+ gather_plan_statistics */ count(distinct itm1.itm_id) FROM ita ita1, ita ita2, itm itm1, itm itm2, itm
itm3 where itm1.itm_container_id = 2812 and itm1.itm_version_id <= 999999999 and itm1.itm_next_version_id
= 999999999 and itm2.itm_primary_key = 'RAYBESTOS' and itm3.itm_primary_key = '1' andita1.ita_node_id = 3111 and itm2.itm_container_id = 2020 and ita1.ita_item_id = itm1.itm_id and
ita1.ita_version_id <= 999999999 and ita1.ita_next_version_id >= 999999999 and itm2.itm_id =
ita1.ita_value_numeric and itm2.itm_version_id <= 999999999 and itm2.itm_next_version_id >= 999999999
and ita2.ita_node_id = 3118 and itm3.itm_container_id = 2025 and ita2.ita_item_id = itm1.itm_id and
ita2.ita_version_id <= 999999999 and ita2.ita_next_version_id >= 999999999 and itm3.itm_id =
ita2.ita_value_numeric and itm3.itm_version_id <= 999999999 and itm3.itm_next_version_id >= 999999999
Plan hash value: 332134648
| Id | Operation | Name | Starts | E-Rows | A-Rows | A-Time | Buffers | OMem | 1Mem | Used-Mem |
| 1 | SORT GROUP BY | | 1 | 1 | 1 |00:01:54.75 | 3041K| 73728 | 73728 | |
| 2 | NESTED LOOPS | | 1 | 1 | 756 |00:00:30.95 | 3041K| | | |
| 3 | NESTED LOOPS | | 1 | 1 | 34939 |00:00:02.73 | 71818 | | | |
| 4 | NESTED LOOPS | | 1 | 1 | 35695 |00:00:00.75 | 230 | | | |
| 5 | MERGE JOIN CARTESIAN| | 1 | 1 | 1 |00:00:00.01 | 6 | | | |
|* 6 | INDEX RANGE SCAN | ICTG_ITM_1 | 1 | 1 | 1 |00:00:00.01 | 3 | | | |
| 7 | BUFFER SORT | | 1 | 1 | 1 |00:00:00.01 | 3 | 73728 | 73728 | |
|* 8 | INDEX RANGE SCAN | ICTG_ITM_1 | 1 | 1 | 1 |00:00:00.01 | 3 | | | |
|* 9 | INDEX RANGE SCAN | ICTG_ITA_1 | 1 | 1 | 35695 |00:00:00.32 | 224 | | | |
|* 10 | INDEX RANGE SCAN | ICTG_ITM_0 | 35695 | 1 | 34939 |00:00:01.19 | 71588 | | | |
|* 11 | INDEX RANGE SCAN | ICTG_ITA_1 | 34939 | 1 | 756 |00:01:52.76 | 2969K| | | |
Predicate Information (identified by operation id):
6 - access("ITM3"."ITM_PRIMARY_KEY"='1' AND "ITM3"."ITM_CONTAINER_ID"=2025 AND
"ITM3"."ITM_NEXT_VERSION_ID">=999999999 AND "ITM3"."ITM_VERSION_ID"<=999999999)
filter("ITM3"."ITM_VERSION_ID"<=999999999)
8 - access("ITM2"."ITM_PRIMARY_KEY"='RAYBESTOS' AND "ITM2"."ITM_CONTAINER_ID"=2020 AND
"ITM2"."ITM_NEXT_VERSION_ID">=999999999 AND "ITM2"."ITM_VERSION_ID"<=999999999)
filter("ITM2"."ITM_VERSION_ID"<=999999999)
9 - access("ITA1"."ITA_NODE_ID"=3111 AND "ITM2"."ITM_ID"="ITA1"."ITA_VALUE_NUMERIC" AND
"ITA1"."ITA_NEXT_VERSION_ID">=999999999 AND "ITA1"."ITA_VERSION_ID"<=999999999)
filter(("ITA1"."ITA_VALUE_NUMERIC" IS NOT NULL AND "ITA1"."ITA_VERSION_ID"<=999999999))
10 - access("ITA1"."ITA_ITEM_ID"="ITM1"."ITM_ID" AND "ITM1"."ITM_NEXT_VERSION_ID">=999999999 AND
"ITM1"."ITM_CONTAINER_ID"=2812 AND "ITM1"."ITM_VERSION_ID"<=999999999)
filter(("ITM1"."ITM_CONTAINER_ID"=2812 AND "ITM1"."ITM_VERSION_ID"<=999999999))
11 - access("ITA2"."ITA_NODE_ID"=3118 AND "ITM3"."ITM_ID"="ITA2"."ITA_VALUE_NUMERIC" AND
"ITA2"."ITA_NEXT_VERSION_ID">=999999999 AND "ITA2"."ITA_ITEM_ID"="ITM1"."ITM_ID" AND
"ITA2"."ITA_VERSION_ID"<=999999999)
filter(("ITA2"."ITA_VALUE_NUMERIC" IS NOT NULL AND "ITA2"."ITA_VERSION_ID"<=999999999 AND
"ITA2"."ITA_ITEM_ID"="ITM1"."ITM_ID"))
51 rows selected.
Elapsed: 00:00:00.28 -
SECURITY query running slow with Prompts!!
Hello All,
Version: PeopleSoft HRMS 9 with PeopleTools 8.49.09
DB Version: 10.2.0.3 (Oracle)
My client is running a security query, given below, with and without prompts. Without prompts it is completing in 35 seconds but with prompts (even if the values in the prompts are blank!), the query is taking more than 4-5 hours but not completing!!
SELECT /*+ OPT_PARAM('_optimizer_mjc_enabled', 'false')
opt_param('_optimizer_cartesian_enabled', 'false') opt_param('optimizer_index_caching', 0) opt_param('optimizer_index_cost_adj', 0)*/ B.OPRID, A.EMPLID, A.PWCUK_LEGACY_ID, A.NAME, A.EMPL_STATUS, A.EMPL_CLASS,
to_char(to_date( TO_CHAR(A.HIRE_DT, 'YYYY-MM-DD'), 'yyyy-mm-dd'), 'dd/mm/yyyy'),
to_char(to_date(decode( TO_CHAR(A.REHIRE_DT, 'YYYY-MM-DD'), '',
TO_CHAR(A.HIRE_DT, 'YYYY-MM-DD'), TO_CHAR(A.REHIRE_DT, 'YYYY-MM-DD')), 'yyyy-mm-dd'), 'dd/mm/yyyy'),
to_char(to_date( TO_CHAR(A.TERMINATION_DT, 'YYYY-MM-DD'), 'yyyy-mm-dd'), 'dd/mm/yyyy'), A.DEPTID, A.DEPT_DESCR, A.PWCUK_BUSINESSUNIT, A.PWCUK_BU_DESCR, A.PWCUK_SUBREGION, A.PWCUK_SR_DESCR,
A.PWCUK_REGION, A.PWCUK_R_DESCR, B.ROWSECCLASS, E.CLASSDEFNDESC, C.ROLENAME, D.DESCR,
Case C.ROLENAME When 'UK_OTG_Query_Access' then 'Y' When 'UK_Self_Service_Query_Access' then 'Y' When 'UK_Prtner_Affairs_Query_Acces' then 'Y' When 'UK_SelfServ_Sens_Basic_Query' then 'Y' When 'UK_ESC_Extra_Query_Access' then 'Y' When 'UK_BCI_Query_Access' then 'Y' When 'UK_Self_Service_Non_Sens_Q Acc' then 'Y' Else 'N' END, TO_CHAR(A.EFFDT, 'YYYY-MM-DD'),
TO_CHAR(A.EFFDT, 'YYYY-MM-DD'), D.ROLENAME FROM PS_PWCUK_EMP_C_VW A, PS_PERS_SRCH_QRY A1, PSOPRDEFN B, PS_ROLEU SER_VW C, PSROLEDEFN D, PSCLASSDEFN E WHERE A.EMPLID = A1.EMPLID
AND A1.OPRID = 'kcooper001a' AND ( B.OPRID = A.PWCE_GUID AND B.OPRID = C.OPRID AND C.ROLENAME NOT IN ('Orbit User', 'PWCUK_LOS_ADMIN_PLANNER', 'Query Designer', 'Query User', 'PWCE_EMEA_AUDIT_RLE_NO_BSE_TBL', 'PWCE_REPORT_DIST', 'EOPP_USER', 'PAPP_USER', 'PWCUK_XMLP_REPORT_DEVELOPER', 'GBR_PEOPLE_MANAGER_CONFIG_UPD', 'PWCUK_EX_EMPLOYEE', 'ReportSuperUser', 'PWCE JOBCODE LOAD UTILITY',
'PWCE EMPLOYEE RVW LOAD ACCESS', 'PwCE Bonus Upload Access', 'GBR_EP_SYSADMIN') AND ( C.ROLENAME NOT LIKE 'PWCUK_EP%' OR C.ROLENAME = 'PWCUK_EP_ADMIN') AND C.ROLENAME NOT LIKE 'PWCUK_SP%' AND C.ROLENAME NOT LIKE 'GBR_PMGR%' AND 0 < INSTR(:1, decode(trim(:2), null, ' ', B.OPRID)) AND 0 < INSTR(:3, decode(trim(:4), null, ' ', B.EMPLID)) AND 0 < INSTR(:5, decode(trim(:6), null, ' ', A.PWCUK_LEGACY_ID)) A
ND 0 < INSTR(:7, decode(trim(:8), null, ' ', C.ROLENAME)) AND 0 < INSTR(:9, decode(trim(:10), null, ' ', E.CLASSID)) AND C.ROLENAME = D.ROLENAME AND E.CLASSID = B.ROWSECCLASS ) ORDER BY 4, 20Below are some more useful information I have gathered from DB level for this query:
+--------------------------------------------------------------------------------------------------+
|Plan HV Min Snap Max Snap Execs LIO PIO CPU Elapsed |
+--------------------------------------------------------------------------------------------------+
|770792495 39602 39747 5 1,181,648,326 6,823 7,433.93 7,481.60 |
+--------------------------------------------------------------------------------------------------+
========== PHV = 770792495==========
First seen from "10/19/12 10:00:44" (snap #39602)
Last seen from "10/25/12 11:00:28" (snap #39747)
Execs LIO PIO CPU Elapsed
===== === === === =======
5 1,181,648,326 6,823 7,433.93 7,481.60
Plan hash value: 770792495
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | | | 35 (100)| |
| 1 | SORT ORDER BY | | 1 | 645 | 35 (6)| 00:00:01 |
| 2 | NESTED LOOPS | | 1 | 645 | 34 (3)| 00:00:01 |
| 3 | NESTED LOOPS | | 6 | 1122 | 10 (10)| 00:00:01 |
| 4 | NESTED LOOPS | | 1 | 165 | 5 (0)| 00:00:01 |
| 5 | NESTED LOOPS | | 1 | 122 | 4 (0)| 00:00:01 |
| 6 | NESTED LOOPS | | 1 | 81 | 3 (0)| 00:00:01 |
| 7 | NESTED LOOPS | | 552 | 29256 | 2 (0)| 00:00:01 |
| 8 | INDEX FULL SCAN | PSAPSROLEUSER | 550 | 15950 | 1 (0)| 00:00:01 |
| 9 | TABLE ACCESS BY INDEX ROWID | PS_ROLEXLATOPR | 1 | 24 | 1 (0)| 00:00:01 |
| 10 | INDEX UNIQUE SCAN | PS_ROLEXLATOPR | 1 | | 1 (0)| 00:00:01 |
| 11 | TABLE ACCESS BY INDEX ROWID | PSOPRDEFN | 1 | 28 | 1 (0)| 00:00:01 |
| 12 | INDEX UNIQUE SCAN | PS_PSOPRDEFN | 1 | | 1 (0)| 00:00:01 |
| 13 | TABLE ACCESS BY INDEX ROWID | PSCLASSDEFN | 1 | 41 | 1 (0)| 00:00:01 |
| 14 | INDEX UNIQUE SCAN | PS_PSCLASSDEFN | 1 | | 1 (0)| 00:00:01 |
| 15 | TABLE ACCESS BY INDEX ROWID | PSROLEDEFN | 1 | 43 | 1 (0)| 00:00:01 |
| 16 | INDEX UNIQUE SCAN | PS_PSROLEDEFN | 1 | | 1 (0)| 00:00:01 |
| 17 | VIEW | PS_PERS_SRCH_QRY | 483 | 10626 | 5 (20)| 00:00:01 |
| 18 | SORT UNIQUE | | 483 | 62790 | 5 (20)| 00:00:01 |
| 19 | NESTED LOOPS | | 483 | 62790 | 4 (0)| 00:00:01 |
| 20 | NESTED LOOPS | | 483 | 49749 | 3 (0)| 00:00:01 |
| 21 | NESTED LOOPS | | 1 | 67 | 2 (0)| 00:00:01 |
| 22 | TABLE ACCESS BY INDEX ROWID| PSOPRDEFN | 1 | 40 | 1 (0)| 00:00:01 |
| 23 | INDEX UNIQUE SCAN | PS_PSOPRDEFN | 1 | | 1 (0)| 00:00:01 |
| 24 | TABLE ACCESS BY INDEX ROWID| PS_SJT_OPR_CLS | 1 | 27 | 1 (0)| 00:00:01 |
| 25 | INDEX RANGE SCAN | PS_SJT_OPR_CLS | 1 | | 1 (0)| 00:00:01 |
| 26 | TABLE ACCESS BY INDEX ROWID | PS_SJT_CLASS_ALL | 482 | 17352 | 1 (0)| 00:00:01 |
| 27 | INDEX RANGE SCAN | PS_SJT_CLASS_ALL | 1158 | | 1 (0)| 00:00:01 |
| 28 | INDEX RANGE SCAN | PS_SJT_PERSON | 1 | 27 | 1 (0)| 00:00:01 |
| 29 | VIEW | PS_PWCUK_EMP_C_VW | 1 | 458 | 4 (0)| 00:00:01 |
| 30 | UNION ALL PUSHED PREDICATE | | | | | |
| 31 | TABLE ACCESS BY INDEX ROWID | PS_PWCUK_EMPLOYEES | 1 | 169 | 1 (0)| 00:00:01 |
| 32 | INDEX RANGE SCAN | PS_PWCUK_EMPLOYEES | 1 | | 1 (0)| 00:00:01 |
| 33 | FILTER | | | | | |
| 34 | NESTED LOOPS OUTER | | 1 | 220 | 3 (0)| 00:00:01 |
| 35 | NESTED LOOPS OUTER | | 1 | 208 | 2 (0)| 00:00:01 |
| 36 | TABLE ACCESS BY INDEX ROWID | PS_PWCUK_EX_EMPLS | 1 | 161 | 1 (0)| 00:00:01 |
| 37 | INDEX RANGE SCAN | PS_PWCUK_EX_EMPLS | 1 | | 1 (0)| 00:00:01 |
| 38 | TABLE ACCESS BY INDEX ROWID | PS_PWCE_EP_ROLES | 1 | 47 | 1 (0)| 00:00:01 |
| 39 | INDEX RANGE SCAN | PS_PWCE_EP_ROLES | 1 | | 1 (0)| 00:00:01 |
| 40 | INDEX RANGE SCAN | PS_PWCUK_EMPLOYEES | 1 | 12 | 1 (0)| 00:00:01 |
| 41 | SORT AGGREGATE | | 1 | 23 | | |
| 42 | INDEX RANGE SCAN | PS_PWCE_EP_ROLES | 1 | 23 | 1 (0)| 00:00:01 |
Summary Execution Statistics Over Time
Avg Avg
Snapshot Avg LIO Avg PIO CPU (secs) Elapsed (secs)
Time Execs Per Exec Per Exec Per Exec Per Exec
19-OCT 10:00 1 374,309,812.00 1,469.00 2,286.32 2,291.32
25-OCT 10:00 3 86,033,085.00 1,567.67 543.68 546.11
25-OCT 11:00 1 549,239,259.00 651.00 3,516.56 3,551.96
avg 336,527,385.33 1,229.22 2,115.52 2,129.80
sum 5
Per-Plan Execution Statistics Over Time
Avg Avg
Plan Snapshot Avg LIO Avg PIO CPU (secs) Elapsed (secs)
Hash Value Time Execs Per Exec Per Exec Per Exec Per Exec
770792495 19-OCT 10:00 1 374,309,812.00 1,469.00 2,286.32 2,291.32
25-OCT 10:00 3 86,033,085.00 1,567.67 543.68 546.11
25-OCT 11:00 1 549,239,259.00 651.00 3,516.56 3,551.96
avg 336,527,385.33 1,229.22 2,115.52 2,129.80
sum 5I'm not at all proficient in PeopleSoft.
Please advice how we can get faster runs for this query.
Note: We have already checked all other possibilities, like network, application, web services, etc, and they look normal.
Thanks,
SuddhasatwaIf the hints are there only for the "cost", then I'm sorry to say, but they are useless. Did you say that was not efficient to the Oracle Support ?
I asked earlier if that query already ran in a reasonnable time, is it the case, or always took that time ? Is it a change of behaviour after a db upgrade ?
Have you tried to work with AWR snapshots with a short gap in between ? I mean between the AWR snapshots (every 15 minutes or so), not between the runs of the query.
If there's no values for the bind variables, I assume this is what you mean when you said "no prompts", then Oracle can go much faster because of the few (or no?) data repartition to retrieve.
However, when given values to some (all?) of the bind variables, then all the problem will be on the data repartition. That's why I was asking how you gathered statistics on the involved objects, in other words, the histograms may be wrong somehow.
There's a lot of litterature on this, have a look to the Jonathan Lewis blog for more information.
Anyway, I think there's not enough information here and does not look easy to work on it in that state from the other side of the network.
Nicolas. -
Will an iBook G3 run fast with OS9?
I have a 700mhz iBook G3 with OSX Tiger and maxed out RAM. It runs okay with OSX, but it's slow and the 20gb hard drive runs fairly hot at 50-54 degrees celsius. I was wondering about whether it would run much faster and cooler if I did a clean install of OS9 on it, updating it to 9.2.2. I know a lot of software wouldn't run anymore on it, but the downgrade would be worth it if it would run a LOT faster and be capable of video editing with old versions of Final Cut or Premiere. Would the old versions of Photoshop, internet browsers, etc... be able to create and read decently modern file formats?
Would this work? How much faster would it run? What do you think about this idea?
Please let me know. Thanks.Do you have the original system CDs that came with the iBook?
I wouldn't advise trying to run Mac OS 9 if you want to use the iBook on the internet. The browsers that are available for OS 9 are not nearly as up to speed as those available for Mac OS X.
The iBook is about seven years old, so it is not going to be a speedy computer, no matter what you do. Probably the best upgrade you could make is a new, faster, larger hard drive, but it may not be worth the time, trouble, or expense. -
Making Siebel Run Fast with Oracle CBO – New PPS Recommendation - optimizer
Hi All,
I have some good news if you are upgrading to Oracle CBO. This is a big new find that we discovered a few weeks back.
There is a certain class of queries that run very slow with the default Siebel recommended settings. Please keep in mind that in order to properly do explain plans in 10G with Siebel SQL you need to issue the following alter session statements. Also if you are using TOAD you have to uncheck the run queries in parallel since if that option is checked a new session will be launched and your options won’t be set.
ALTER SESSION SET OPTIMIZER_MODE = FIRST_ROWS_10 ;
ALTER SESSION SET "_OPTIMIZER_SORTMERGE_JOIN_ENABLED" = FALSE ;
ALTER SESSION SET "_OPTIMIZER_JOIN_SEL_SANITY_CHECK" = TRUE;
ALTER SESSION SET "_HASH_JOIN_ENABLED" = FALSE;
The key new find is that the Oracle recommendation of setting optimizer_index_cost_adj = 1 is wrong! Our new recommendation is to set this parameter to 10.
Here are some more details. This is not a silver bullet for all your Oracle performance tuning issues. Remember it is best to tune specific things that are slow from an end users perspective. In fact that is how we discovered this issue and its solution.
There is one specific class of queries that this setting will fix. You can issue alter session statements to see the difference in your explain plans. Here is how you will know the query:
• Where clause on an intersection table and index that exists that would find just one row. This is the index we want Oracle to use.
• Order by on BC base table and another index exists that would satisfy the order by. We don’t want to use this index since millions of rows would be accessed.
• Explain plan shows the index for the order by is used instead of the index for the where clause that would have found a single row.
Here is the actual statement we encountered that lead to our discovery.
WHERE
T8.PR_HELD_POSTN_ID = T2.PAR_ROW_ID (+) AND
T2.BU_ID = T5.ROW_ID (+) AND
T7.ROW_ID = T4.PAR_ROW_ID AND
T7.ROW_ID = T8.PAR_ROW_ID AND
T7.ROW_ID = T3.PAR_ROW_ID AND
T7.ROW_ID = T6.PAR_ROW_ID (+) AND
T8.PR_RESP_ID = T1.ROW_ID (+) AND
(T8.EMP_FLG = 'Y') AND
(T3.LOGIN = 'UATUSER')
ORDER BY
T8.LAST_NAME, T8.FST_NAME
In addition at OOW this week we heard that an Oracle RAC expert presented Siebel on RAC and recommended setting this parameter back to its default of 100. We also talked with a very senior DBA colleague who made the same discovery over a year ago and is running with is parameter set to 25.
I can tell you that for us any setting from 1-9 gave the bad access path. 10 fixes the issue.
This find is so important that we wanted to get this out to the Siebel community ASAP.
Robert Ponder
Lead Architect and Director
Ponder Pro Serve
cell: 770.490.2767
fax: 770.412.8259
email: [email protected]
web: www.ponderproserve.comHi All,
I know it is bad to reply to your own posts but this one is too good. Here is another example of this that all of us have.
With oica = 1 the m1 index is used and this runs a long time. With oica = 10 m6 is used and that clearly is the index Oracle wants to use since it matches the where clause exactly.
This is from the basic select we all run as part of Server Tables Clean Up. I am even including the alter session statements so you can see the drastic improvement yourself.
ALTER SESSION SET optimizer_mode = FIRST_ROWS_10;
ALTER SESSION SET "_OPTIMIZER_SORTMERGE_JOIN_ENABLED" = FALSE;
ALTER SESSION SET "_OPTIMIZER_JOIN_SEL_SANITY_CHECK" = TRUE;
ALTER SESSION SET HASH_JOIN_ENABLED = FALSE; -- "_HASH_JOIN_ENABLED" in 10G
ALTER SESSION SET OPTIMIZER_INDEX_COST_ADJ = 1; -- then change this to 10 and run EP again.
SELECT
T1.CONFLICT_ID,
T1.LAST_UPD,
T1.CREATED,
T1.LAST_UPD_BY,
T1.CREATED_BY,
T1.MODIFICATION_NUM,
T1.ROW_ID,
T1.ACTION_ID
FROM
SIEBEL.S_SRM_REQUEST T1
WHERE
((T1.STATUS IN ( 'SUCCESS' ) OR T1.STATUS IN ( 'EXPIRED' ) OR T1.STATUS IN ( 'COMPLETE' ))
AND T1.TGT_DELETE_TS <= TO_DATE('11/20/2007 16:26:27','MM/DD/YYYY HH24:MI:SS'))
***** SQL Statement Execute Time for SQL Cursor with ID 10A53620: 48.333 seconds ***** -
Query runs fast in DB but slow in OBIEE
Hello guys
I am running some reports on the dashboard, which takes forever to come up. I capture the generated SQL and ran it in Toad, it would take only less than 2 mins to return the data.
What area of OBIEE configuration should I check to see what's happening?
Much thanksThanks.. Let me show you the query I am executing:
select T1011554.PECODE as c1,
T1011581.DATE as c2,
T1011581.DAYOFWEEK as c3
from
RD_TOT.TRANSACTIONTYPE T1011554 /*Transaction */ ,
RD_TOT.V_FACTS_SNAPSHOT_12 T1011580 /* Facts */ ,
RD_TOT.DATES T1011581 /* Date */
where ( T1011554.TRANSACTIONTYPEID = T1011580.TRANSACTIONTYPEID and T1011554.TRANSACTIONTYPECODE = '2' and T1011581.DAYOFWEEK = 'Monday' and T1011580.DOCUMENTCOMPANY = T1011581.COMPANYNUMBER and T1011580.SNAPSHOTDATE = T1011581.DATES and T1011581.DATES < TO_DATE('2009-10-28' , 'YYYY-MM-DD') )
When I run this query in Toad, it takes less than 30s to return, but from OBIEE, it's taking forever.. I am using Oracle 10g as DB... I am sure there are a lot of rows being fetched, because using the result I am getting in toad, if I do a record count, that process will take forever again..
There might be some configuration setup I need to do in OBIEE or config file. This is just my feelings, but I'd like to hear any of your thoughts and suggestions..
Much appreciated!
Thanks -
BEX WAD 7.0: Chart Takes Long Time to Display in Portal - Query runs FAST
I have a BEx WAD 7.0 template which contains 3 column charts (each with it's own seperate DataProvider/Query). When the page loads...two of the charts show up right away, but one of them takes almost a minute to display on the screen (I thought it was missing at first).
I ran all three queries in the BEx Query Analyzer (including the one for the chart that takes forever to load) and they all complete within 3 seconds of hitting "Execute." So I don't believe it is the query causing this issue.
The chart that doesn't show up right away does have more data to display than the other two...but I have queries/charts on other web templates that contain 3-times the data of this one and show up fine when executed in the portal.
Anyone else having this issue or have an idea on how I can optimize the WAD charts and/or find out what is causing this issue? Again...the query that fuels this chart completes its execution in about 3-4 seconds.
Thank you for your time and of course points will be assigned accordingly.
KevinHi,
have you already checked how much time the IGS consumes when creating the charts?
Run TA SIGS and check the statistics values.
Regards, Kai -
What can I do to make this query run faster
Hi All,
The below query is taking a long time. Is there any thing that I can do to shorten its time.
SELECT C.FOLIO_NO, C.CO_TRANS_NO TRANS_NO, to_char(C.CREATED_DATE, 'dd/mm/yyyy') DOC_DATE, DECODE(PP.NAME, NULL, D.EMP_NAME, PP.NAME) LODGED_BY, decode(sf_fetch_datechange(c.co_trans_no, C.CO_TRANS_ID), Null, '-', sf_fetch_datechange(c.co_trans_no, C.CO_TRANS_ID)) DATE_CHANGE, P.RECEIPT_NO, decode(c.co_trans_id,'A020',(select nvl(base_trans_id,co_trans_id) from co_form5a_trans f where f.co_trans_no=c.co_trans_no),c.co_trans_id) TRANS_ID,(case when decode(c.co_trans_id,'A020',(select nvl(base_trans_id,co_trans_id) from co_form5a_trans f where f.co_trans_no=c.co_trans_no),c.co_trans_id)='AR20' then 1 when decode(c.co_trans_id,'A020',(select nvl(base_trans_id,co_trans_id) from co_form5a_trans f where f.co_trans_no=c.co_trans_no),c.co_trans_id)='AR03' then 2 end) TRANS_TYPE FROM CO_TRANS_MASTER C, PAYMENT_DETAIL P, PEOPLE_PROFILE PP, SC_AGENT_EMP D, M_CAA_TRANS E where '1' <> TRIM(UPPER('S0750070Z')) and (C.CO_TRANS_ID in TRIM(UPPER('AR20')) OR C.CO_TRANS_ID in TRIM(UPPER('AR03'))OR c.co_trans_id IN TRIM (UPPER ('A020')))and C.CO_TRANS_NO = P.TRANS_NO and (C.VOID_IND = 'N' or C.VOID_IND is Null) and C.CREATED_BY = PP.PP_ID(+) and C.PROF_NO = D.PROF_NO(+) and C.CREATED_BY = D.EMP_ID (+) and TRIM(UPPER(C.CO_NO)) = TRIM(UPPER('200101586W')) and c.co_trans_id = e.trans_id (+) order by FOLIO_NO;
SQL>
SQL> show parameter user_dump_dest
NAME TYPE VALUE
user_dump_dest string /u01/app/oracle/diag/rdbms/ebi
zfile/EBIZFILE1/trace
SQL> show parameter optimizer
NAME TYPE VALUE
optimizer_capture_sql_plan_baselines boolean FALSE
optimizer_dynamic_sampling integer 2
optimizer_features_enable string 11.2.0.2
optimizer_index_caching integer 0
optimizer_index_cost_adj integer 100
optimizer_mode string ALL_ROWS
optimizer_secure_view_merging boolean TRUE
optimizer_use_invisible_indexes boolean FALSE
optimizer_use_pending_statistics boolean FALSE
optimizer_use_sql_plan_baselines boolean TRUE
SQL> show parameter db_file_multi
NAME TYPE VALUE
db_file_multiblock_read_count integer 128
SQL> show parameter db_block_size
NAME TYPE VALUE
db_block_size integer 8192
SQL> show parameter cursor_sharing
NAME TYPE VALUE
cursor_sharing string EXACT
SQL>
SQL> column sname format a20
SQL> column pname format a20
SQL> column pval2 format a20
SQL>
SQL> select
2 sname, pname, pval1, pval2
3 from
4 sys.aux_stats$;
SNAME PNAME PVAL1 PVAL2
SYSSTATS_INFO STATUS COMPLETED
SYSSTATS_INFO DSTART 09-11-2010 14:25
SYSSTATS_INFO DSTOP 09-11-2010 14:25
SYSSTATS_INFO FLAGS 1
SYSSTATS_MAIN CPUSPEEDNW 739.734748
SYSSTATS_MAIN IOSEEKTIM 10
SYSSTATS_MAIN IOTFRSPEED 4096
SYSSTATS_MAIN SREADTIM
SYSSTATS_MAIN MREADTIM
SYSSTATS_MAIN CPUSPEED
SYSSTATS_MAIN MBRC
SYSSTATS_MAIN MAXTHR
SYSSTATS_MAIN SLAVETHR
13 rows selected.
Elapsed: 00:00:00.06
SQL>
SQL> explain plan for
2 SELECT C.FOLIO_NO, C.CO_TRANS_NO TRANS_NO, to_char(C.CREATED_DATE, 'dd/mm/yyyy') DOC_DATE, DECODE(PP.NAME, NULL, D.EMP_NAME, PP.NAME) LODGED_BY, decode(sf_fetch_datechange(c.co_trans_no, C.CO_TRANS_ID), Null, '-', sf_fetch_datechange(c.co_trans_no, C.CO_TRANS_ID)) DATE_CHANGE, P.RECEIPT_NO, decode(c.co_trans_id,'A020',(select nvl(base_trans_id,co_trans_id) from co_form5a_trans f where f.co_trans_no=c.co_trans_no),c.co_trans_id) TRANS_ID,(case when decode(c.co_trans_id,'A020',(select nvl(base_trans_id,co_trans_id) from co_form5a_trans f where f.co_trans_no=c.co_trans_no),c.co_trans_id)='AR20' then 1 when decode(c.co_trans_id,'A020',(select nvl(base_trans_id,co_trans_id) from co_form5a_trans f where f.co_trans_no=c.co_trans_no),c.co_trans_id)='AR03' then 2 end) TRANS_TYPE FROM CO_TRANS_MASTER C, PAYMENT_DETAIL P, PEOPLE_PROFILE PP, SC_AGENT_EMP D, M_CAA_TRANS E where '1' <> TRIM(UPPER('S0750070Z')) and (C.CO_TRANS_ID in TRIM(UPPER('AR20')) OR C.CO_TRANS_ID in TRIM(UPPER('AR03'))OR c.co_trans_id IN TRIM (UPPER ('A020')))and C.CO_TRANS_NO = P.TRANS_NO and (C.VOID_IND = 'N' or C.VOID_IND is Null) and C.CREATED_BY = PP.PP_ID(+) and C.PROF_NO = D.PROF_NO(+) and C.CREATED_BY = D.EMP_ID (+) and TRIM(UPPER(C.CO_NO)) = TRIM(UPPER('200101586W')) and c.co_trans_id = e.trans_id (+) order by FOLIO_NO;
Explained.
Elapsed: 00:00:00.09
SQL>
SQL> set pagesize 1000;
SQL> set linesize 170;
SQL> @/u01/app/oracle/product/11.2.0/rdbms/admin/utlxpls.sql
SQL> Rem
SQL> Rem $Header: utlxpls.sql 26-feb-2002.19:49:37 bdagevil Exp $
SQL> Rem
SQL> Rem utlxpls.sql
SQL> Rem
SQL> Rem Copyright (c) 1998, 2002, Oracle Corporation. All rights reserved.
SQL> Rem
SQL> Rem NAME
SQL> Rem utlxpls.sql - UTiLity eXPLain Serial plans
SQL> Rem
SQL> Rem DESCRIPTION
SQL> Rem script utility to display the explain plan of the last explain plan
SQL> Rem command. Do not display information related to Parallel Query
SQL> Rem
SQL> Rem NOTES
SQL> Rem Assume that the PLAN_TABLE table has been created. The script
SQL> Rem utlxplan.sql should be used to create that table
SQL> Rem
SQL> Rem With SQL*plus, it is recomended to set linesize and pagesize before
SQL> Rem running this script. For example:
SQL> Rem set linesize 100
SQL> Rem set pagesize 0
SQL> Rem
SQL> Rem MODIFIED (MM/DD/YY)
SQL> Rem bdagevil 02/26/02 - cast arguments
SQL> Rem bdagevil 01/23/02 - rewrite with new dbms_xplan package
SQL> Rem bdagevil 04/05/01 - include CPU cost
SQL> Rem bdagevil 02/27/01 - increase Name column
SQL> Rem jihuang 06/14/00 - change order by to order siblings by.
SQL> Rem jihuang 05/10/00 - include plan info for recursive SQL in LE row source
SQL> Rem bdagevil 01/05/00 - add order-by to make it deterministic
SQL> Rem kquinn 06/28/99 - 901272: Add missing semicolon
SQL> Rem bdagevil 05/07/98 - Explain plan script for serial plans
SQL> Rem bdagevil 05/07/98 - Created
SQL> Rem
SQL>
SQL> set markup html preformat on
SQL>
SQL> Rem
SQL> Rem Use the display table function from the dbms_xplan package to display the last
SQL> Rem explain plan. Force serial option for backward compatibility
SQL> Rem
SQL> select plan_table_output from table(dbms_xplan.display('plan_table',null,'serial'));
PLAN_TABLE_OUTPUT
Plan hash value: 2520189693
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 592 | 85248 | 16573 (1)| 00:03:19 |
| 1 | TABLE ACCESS BY INDEX ROWID | CO_FORM5A_TRANS | 1 | 20 | 2 (0)| 00:00:01 |
|* 2 | INDEX UNIQUE SCAN | SYS_C0059692 | 1 | | 1 (0)| 00:00:01 |
| 3 | TABLE ACCESS BY INDEX ROWID | CO_FORM5A_TRANS | 1 | 20 | 2 (0)| 00:00:01 |
|* 4 | INDEX UNIQUE SCAN | SYS_C0059692 | 1 | | 1 (0)| 00:00:01 |
| 5 | TABLE ACCESS BY INDEX ROWID | CO_FORM5A_TRANS | 1 | 20 | 2 (0)| 00:00:01 |
|* 6 | INDEX UNIQUE SCAN | SYS_C0059692 | 1 | | 1 (0)| 00:00:01 |
| 7 | SORT ORDER BY | | 592 | 85248 | 16573 (1)| 00:03:19 |
| 8 | NESTED LOOPS | | | | | |
| 9 | NESTED LOOPS | | 592 | 85248 | 16572 (1)| 00:03:19 |
| 10 | NESTED LOOPS OUTER | | 477 | 54855 | 15329 (1)| 00:03:04 |
| 11 | NESTED LOOPS OUTER | | 477 | 41499 | 14374 (1)| 00:02:53 |
| 12 | INLIST ITERATOR | | | | | |
|* 13 | TABLE ACCESS BY INDEX ROWID| CO_TRANS_MASTER | 477 | 22896 | 14367 (1)| 00:02:53 |
|* 14 | INDEX RANGE SCAN | IDX_CO_TRANS_ID | 67751 | | 150 (1)| 00:00:02 |
| 15 | TABLE ACCESS BY INDEX ROWID | SC_AGENT_EMP | 1 | 39 | 1 (0)| 00:00:01 |
|* 16 | INDEX UNIQUE SCAN | PK_SC_AGENT_EMP | 1 | | 0 (0)| 00:00:01 |
| 17 | TABLE ACCESS BY INDEX ROWID | PEOPLE_PROFILE | 1 | 28 | 2 (0)| 00:00:01 |
|* 18 | INDEX UNIQUE SCAN | SYS_C0063100 | 1 | | 1 (0)| 00:00:01 |
|* 19 | INDEX RANGE SCAN | IDX_PAY_DETAIL_TRANS_NO | 1 | | 2 (0)| 00:00:01 |
| 20 | TABLE ACCESS BY INDEX ROWID | PAYMENT_DETAIL | 1 | 29 | 3 (0)| 00:00:01 |
Predicate Information (identified by operation id):
2 - access("F"."CO_TRANS_NO"=:B1)
4 - access("F"."CO_TRANS_NO"=:B1)
6 - access("F"."CO_TRANS_NO"=:B1)
13 - filter(TRIM(UPPER("SYS_ALIAS_3"."CO_NO"))='200101586W' AND ("SYS_ALIAS_3"."VOID_IND" IS NULL
OR "SYS_ALIAS_3"."VOID_IND"='N'))
14 - access("SYS_ALIAS_3"."CO_TRANS_ID"='A020' OR "SYS_ALIAS_3"."CO_TRANS_ID"='AR03' OR
"SYS_ALIAS_3"."CO_TRANS_ID"='AR20')
16 - access("SYS_ALIAS_3"."PROF_NO"="D"."PROF_NO"(+) AND
"SYS_ALIAS_3"."CREATED_BY"="D"."EMP_ID"(+))
18 - access("SYS_ALIAS_3"."CREATED_BY"="PP"."PP_ID"(+))
19 - access("SYS_ALIAS_3"."CO_TRANS_NO"="P"."TRANS_NO")
42 rows selected.
Elapsed: 00:00:00.53
SQL>
SQL>
SQL>
SQL> rollback;
Rollback complete.
Elapsed: 00:00:00.01
SQL>
SQL> rem Set the ARRAYSIZE according to your application
SQL> set autotrace traceonly arraysize 100
SQL>
SQL> alter session set tracefile_identifier = 'mytrace1';
Session altered.
Elapsed: 00:00:00.00
SQL>
SQL> rem if you're using bind variables
SQL> rem define them here
SQL>
SQL> rem variable b_var1 number
SQL> rem variable b_var2 varchar2(20)
SQL>
SQL> rem and initialize them
SQL>
SQL> rem exec :b_var1 := 1
SQL> rem exec :b_var2 := 'DIAG'
SQL> set pagesize 1000;
SQL> set linesize 170;
SQL> alter session set events '10046 trace name context forever, level 8';
Session altered.
Elapsed: 00:00:00.01
SQL> SELECT C.FOLIO_NO, C.CO_TRANS_NO TRANS_NO, to_char(C.CREATED_DATE, 'dd/mm/yyyy') DOC_DATE, DECODE(PP.NAME, NULL, D.EMP_NAME, PP.NAME) LODGED_BY, decode(sf_fetch_datechange(c.co_trans_no, C.CO_TRANS_ID), Null, '-', sf_fetch_datechange(c.co_trans_no, C.CO_TRANS_ID)) DATE_CHANGE, P.RECEIPT_NO, decode(c.co_trans_id,'A020',(select nvl(base_trans_id,co_trans_id) from co_form5a_trans f where f.co_trans_no=c.co_trans_no),c.co_trans_id) TRANS_ID,(case when decode(c.co_trans_id,'A020',(select nvl(base_trans_id,co_trans_id) from co_form5a_trans f where f.co_trans_no=c.co_trans_no),c.co_trans_id)='AR20' then 1 when decode(c.co_trans_id,'A020',(select nvl(base_trans_id,co_trans_id) from co_form5a_trans f where f.co_trans_no=c.co_trans_no),c.co_trans_id)='AR03' then 2 end) TRANS_TYPE FROM CO_TRANS_MASTER C, PAYMENT_DETAIL P, PEOPLE_PROFILE PP, SC_AGENT_EMP D, M_CAA_TRANS E where '1' <> TRIM(UPPER('S0750070Z')) and (C.CO_TRANS_ID in TRIM(UPPER('AR20')) OR C.CO_TRANS_ID in TRIM(UPPER('AR03'))OR c.co_trans_id IN TRIM (UPPER ('A020')))and C.CO_TRANS_NO = P.TRANS_NO and (C.VOID_IND = 'N' or C.VOID_IND is Null) and C.CREATED_BY = PP.PP_ID(+) and C.PROF_NO = D.PROF_NO(+) and C.CREATED_BY = D.EMP_ID (+) and TRIM(UPPER(C.CO_NO)) = TRIM(UPPER('200101586W')) and c.co_trans_id = e.trans_id (+) order by FOLIO_NO;
10 rows selected.
Elapsed: 00:03:42.27
Execution Plan
Plan hash value: 2520189693
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 592 | 85248 | 16573 (1)| 00:03:19 |
| 1 | TABLE ACCESS BY INDEX ROWID | CO_FORM5A_TRANS | 1 | 20 | 2 (0)| 00:00:01 |
|* 2 | INDEX UNIQUE SCAN | SYS_C0059692 | 1 | | 1 (0)| 00:00:01 |
| 3 | TABLE ACCESS BY INDEX ROWID | CO_FORM5A_TRANS | 1 | 20 | 2 (0)| 00:00:01 |
|* 4 | INDEX UNIQUE SCAN | SYS_C0059692 | 1 | | 1 (0)| 00:00:01 |
| 5 | TABLE ACCESS BY INDEX ROWID | CO_FORM5A_TRANS | 1 | 20 | 2 (0)| 00:00:01 |
|* 6 | INDEX UNIQUE SCAN | SYS_C0059692 | 1 | | 1 (0)| 00:00:01 |
| 7 | SORT ORDER BY | | 592 | 85248 | 16573 (1)| 00:03:19 |
| 8 | NESTED LOOPS | | | | | |
| 9 | NESTED LOOPS | | 592 | 85248 | 16572 (1)| 00:03:19 |
| 10 | NESTED LOOPS OUTER | | 477 | 54855 | 15329 (1)| 00:03:04 |
| 11 | NESTED LOOPS OUTER | | 477 | 41499 | 14374 (1)| 00:02:53 |
| 12 | INLIST ITERATOR | | | | | |
|* 13 | TABLE ACCESS BY INDEX ROWID| CO_TRANS_MASTER | 477 | 22896 | 14367 (1)| 00:02:53 |
|* 14 | INDEX RANGE SCAN | IDX_CO_TRANS_ID | 67751 | | 150 (1)| 00:00:02 |
| 15 | TABLE ACCESS BY INDEX ROWID | SC_AGENT_EMP | 1 | 39 | 1 (0)| 00:00:01 |
|* 16 | INDEX UNIQUE SCAN | PK_SC_AGENT_EMP | 1 | | 0 (0)| 00:00:01 |
| 17 | TABLE ACCESS BY INDEX ROWID | PEOPLE_PROFILE | 1 | 28 | 2 (0)| 00:00:01 |
|* 18 | INDEX UNIQUE SCAN | SYS_C0063100 | 1 | | 1 (0)| 00:00:01 |
|* 19 | INDEX RANGE SCAN | IDX_PAY_DETAIL_TRANS_NO | 1 | | 2 (0)| 00:00:01 |
| 20 | TABLE ACCESS BY INDEX ROWID | PAYMENT_DETAIL | 1 | 29 | 3 (0)| 00:00:01 |
Predicate Information (identified by operation id):
2 - access("F"."CO_TRANS_NO"=:B1)
4 - access("F"."CO_TRANS_NO"=:B1)
6 - access("F"."CO_TRANS_NO"=:B1)
13 - filter(TRIM(UPPER("SYS_ALIAS_3"."CO_NO"))='200101586W' AND ("SYS_ALIAS_3"."VOID_IND" IS NULL
OR "SYS_ALIAS_3"."VOID_IND"='N'))
14 - access("SYS_ALIAS_3"."CO_TRANS_ID"='A020' OR "SYS_ALIAS_3"."CO_TRANS_ID"='AR03' OR
"SYS_ALIAS_3"."CO_TRANS_ID"='AR20')
16 - access("SYS_ALIAS_3"."PROF_NO"="D"."PROF_NO"(+) AND
"SYS_ALIAS_3"."CREATED_BY"="D"."EMP_ID"(+))
18 - access("SYS_ALIAS_3"."CREATED_BY"="PP"."PP_ID"(+))
19 - access("SYS_ALIAS_3"."CO_TRANS_NO"="P"."TRANS_NO")
Statistics
51 recursive calls
0 db block gets
651812 consistent gets
92202 physical reads
0 redo size
1594 bytes sent via SQL*Net to client
524 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
10 rows processed
SQL>
SQL> disconnect
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> Thanks in advance!Hi Raj,
I have given the output below as you requested....
QL> select * from table(dbms_xplan.display_cursor(null, null, 'ALLSTATS LAST'));
PLAN_TABLE_OUTPUT
SQL_ID 0taz7ckjm41yv, child number 1
SELECT C.FOLIO_NO, C.CO_TRANS_NO TRANS_NO, to_char(C.CREATED_DATE,
'dd/mm/yyyy') DOC_DATE, DECODE(PP.NAME, NULL, D.EMP_NAME, PP.NAME)
LODGED_BY, decode(sf_fetch_datechange(c.co_trans_no, C.CO_TRANS_ID),
Null, '-', sf_fetch_datechange(c.co_trans_no, C.CO_TRANS_ID))
DATE_CHANGE, P.RECEIPT_NO, decode(c.co_trans_id,'A020',(select
nvl(base_trans_id,co_trans_id) from co_form5a_trans f where
f.co_trans_no=c.co_trans_no),c.co_trans_id) TRANS_ID,(case when
decode(c.co_trans_id,'A020',(select nvl(base_trans_id,co_trans_id) from
co_form5a_trans f where f.co_trans_no=c.co_trans_no),c.co_trans_id)='AR2
0' then 1 when decode(c.co_trans_id,'A020',(select
nvl(base_trans_id,co_trans_id) from co_form5a_trans f where
f.co_trans_no=c.co_trans_no),c.co_trans_id)='AR03' then 2 end)
TRANS_TYPE FROM CO_TRANS_MASTER C, PAYMENT_DETAIL P, PEOPLE_PROFILE PP,
SC_AGENT_EMP D, M_CAA_TRANS E where '1' <> TRIM(UPPER('S0750070Z')) and
(C.CO_TRANS_ID in TRIM(UPPER('AR20')) OR C.CO_TRANS_ID in
TRIM(UPPER('AR03'))OR c.co
Plan hash value: 4175354585
| Id | Operation | Name | E-Rows | OMem | 1Mem | Used-Mem |
| 0 | SELECT STATEMENT | | | | | |
| 1 | TABLE ACCESS BY INDEX ROWID | CO_FORM5A_TRANS | 1 | | | |
|* 2 | INDEX UNIQUE SCAN | SYS_C0059692 | 1 | | | |
| 3 | TABLE ACCESS BY INDEX ROWID | CO_FORM5A_TRANS | 1 | | | |
|* 4 | INDEX UNIQUE SCAN | SYS_C0059692 | 1 | | | |
| 5 | TABLE ACCESS BY INDEX ROWID | CO_FORM5A_TRANS | 1 | | | |
|* 6 | INDEX UNIQUE SCAN | SYS_C0059692 | 1 | | | |
| 7 | SORT ORDER BY | | 12 | 2048 | 2048 | 2048 (0)|
| 8 | NESTED LOOPS | | | | | |
| 9 | NESTED LOOPS | | 12 | | | |
| 10 | NESTED LOOPS OUTER | | 10 | | | |
| 11 | NESTED LOOPS OUTER | | 10 | | | |
|* 12 | TABLE ACCESS FULL | CO_TRANS_MASTER | 10 | | | |
| 13 | TABLE ACCESS BY INDEX ROWID| SC_AGENT_EMP | 1 | | | |
|* 14 | INDEX UNIQUE SCAN | PK_SC_AGENT_EMP | 1 | | | |
| 15 | TABLE ACCESS BY INDEX ROWID | PEOPLE_PROFILE | 1 | | | |
|* 16 | INDEX UNIQUE SCAN | SYS_C0063100 | 1 | | | |
|* 17 | INDEX RANGE SCAN | IDX_PAY_DETAIL_TRANS_NO | 1 | | | |
| 18 | TABLE ACCESS BY INDEX ROWID | PAYMENT_DETAIL | 1 | | | |
Predicate Information (identified by operation id):
2 - access("F"."CO_TRANS_NO"=:B1)
4 - access("F"."CO_TRANS_NO"=:B1)
6 - access("F"."CO_TRANS_NO"=:B1)
12 - filter((INTERNAL_FUNCTION("SYS_ALIAS_3"."CO_TRANS_ID") AND
TRIM(UPPER("SYS_ALIAS_3"."CO_NO"))='200101586W' AND ("SYS_ALIAS_3"."VOID_IND" IS NULL OR
"SYS_ALIAS_3"."VOID_IND"='N')))
14 - access("SYS_ALIAS_3"."PROF_NO"="D"."PROF_NO" AND "SYS_ALIAS_3"."CREATED_BY"="D"."EMP_ID")
16 - access("SYS_ALIAS_3"."CREATED_BY"="PP"."PP_ID")
17 - access("SYS_ALIAS_3"."CO_TRANS_NO"="P"."TRANS_NO")
Note
- cardinality feedback used for this statement
- Warning: basic plan statistics not available. These are only collected when:
* hint 'gather_plan_statistics' is used for the statement or
* parameter 'statistics_level' is set to 'ALL', at session or system level
65 rows selected. -
Hi All,
I have a query which runs with in 4 mins in Toad and also report 6i. But when ran through applications takes 3 to 4 hrs to complete normal.This report fetches huge amount of data will that be the reason for poor performance?? I am unable to figure that out. I was able to avoid full table scan on the tables used. But still have the problem.
Any suggestions please.
Thank you in advance.
PrathimaIf you want to have a look at the query. This report gives a way to monitor the receipts entered for pay from receipt POs.
SELECT
hou.name "OPERATING_UNIT_NAME"
,glc.segment1 "UEC"
,glc.segment2 "DEPT"
,pov.vendor_name "VENDOR_NAME"
,msi.SEGMENT1 "ITEM_NUM"
,rcvs.receipt_num "RECEIPT_NUM"
,poh.segment1 "PO_NUMBER"
,pol.line_num "PO_LINE_NUM"
,por.RELEASE_NUM "RELEASE_NUMBER"
,poll.shipment_num "SHIPMENT_NUM"
,hrou.name "SHIP_TO_ORGANIZATION"
,trunc(rcv.transaction_date) "TRANSACTION_DATE"
,decode (transaction_type,'RECEIVE', 'ERS', 'RETURN TO VENDOR','RTS') "RECEIPT_TYPE"
,decode (rcv.transaction_type,'RECEIVE', 1, 'RETURN TO VENDOR', -1)* rcv.quantity "RECEIPT_QTY"
,rcv.po_unit_price "PO_UNIT_PRICE"
,decode (rcv.transaction_type,'RECEIVE', 1, 'RETURN TO VENDOR', -1)*rcv.quantity*po_unit_price "RECEIPT_AMOUNT"
,rcvs.packing_slip "PACKING_SLIP"
,poll.quantity "QUANTITY_ORDERED"
,poll.quantity_received "QUANTITY_RECEIVED"
,poll.quantity_accepted "QUANTITY_ACCEPTED"
,poll.quantity_rejected "QUANTITY_REJECTED"
,poll.quantity_billed "QUANTITY_BILLED"
,poll.quantity_cancelled "QUANTITY_CANCELLED"
,(poll.quantity_received - (poll.quantity - poll.quantity_cancelled)) "QUANTITY_OVER_RECEIVED"
,(poll.quantity_received - (poll.quantity - poll.quantity_cancelled))*po_unit_price "OVER_RECEIVED_AMOUNT"
,poh.currency_code "CURRENCY_CODE"
,perr.full_name "RECEIVER"
,perb.full_name "BUYER"
FROM
po.po_vendors pov
,po.po_headers_all poh
,po.po_lines_all pol
,po.po_line_locations_all poll
,po.po_distributions_all pod
,po.po_releases_all por
,hr.hr_all_organization_units hou
,hr.hr_all_organization_units hrou
,po.rcv_transactions rcv
,po.rcv_shipment_headers rcvs
,gl.gl_code_combinations glc
,hr.per_all_people_f perr
,hr.per_all_people_f perb
,inv.mtl_system_items_b msi
where
poh.org_id = hou.organization_id
and pov.vendor_id (+) = poh.vendor_id
and pod.po_header_id = poh.po_header_id
and pod.po_line_id = pol.po_line_id
and pod.line_location_id = poll.line_location_id
and poll.po_header_id = poh.po_header_id
and poll.po_line_id = pol.po_line_id
and pol.po_header_id = poh.po_header_id
and poh.pay_on_code like 'RECEIPT'
and pod.po_header_id = rcv.po_header_id
and pod.po_line_id = rcv.po_line_id
and pod.po_release_id = rcv.po_release_id
and pod.po_release_id = por.po_release_id
and por.po_header_id = poh.po_header_id
and hrou.organization_id = poll.ship_to_organization_id
and pod.line_location_id = rcv.po_line_location_id
and pod.po_distribution_id = rcv.po_distribution_id
and rcv.transaction_type in ('RECEIVE','RETURN TO VENDOR')
and rcv.shipment_header_id = rcvs.shipment_header_id (+)
and pod.code_combination_id = glc.code_combination_id
and rcvs.employee_id = perr.person_id
and por.agent_id = perb.person_id (+)
and perr.person_type_id = 1
and perb.person_type_id = 1
and msi.organization_id = 1 --poll.ship_to_organization_id
and msi.inventory_item_id = pol.item_id
and poh.type_lookup_code = 'BLANKET'
and hou.organization_id = nvl(:p_operating_unit,hou.organization_id)
and trunc(rcv.transaction_date) between :p_transaction_date_from and :p_transaction_date_to
Message was edited by:
Prathima -
MDX query Running slow in SSRS than in SSMS
Hi,
I have a SSRS report which takes 37 secs to execute a single MDX query whereas the same query takes less than 1 sec in SSMS.
I tried removing the parameters and hardcoding default values, still it takes same time. I also tried using OLE DB data source which also takes same time.
Please help.Hi Purush,
According to your description, the query execute time in SQL Server Management Studio (SSMS) takes less than that in SQL Server Reporting Services (SSRS) report, right? As per my understanding, this is normal phenomenon. Because when we run a query on the
query designer of the report, first we need pass the query to database, then execute the query and then return the result to query designer. So this 1 second can the time that used to pass the query to database and return the result.
Hope this helps.
Regards,
Charlie Liao
TechNet Community Support -
Execute query run fine with numeric data not give result on string data
Hi master
Sir I use under blow code for execute query
sir when I use numeric data then run fine but when I use character data then not give any result
with numeric run fine
DECLARE
DD VARCHAR2(15);
BEGIN
DD:=10;
set_block_property('emp', default_where, 'where DEPTNO='||DD);
go_block('emp');
execute_query;
set_block_property('emp', default_where, '');
END;
With character not give any result
DECLARE
DD VARCHAR2(15);
BEGIN
DD:='SALESMAN';
set_block_property('emp', default_where, 'where RTRIM(EMPNO)='||DD);
go_block('emp');
execute_query;
set_block_property('emp', default_where, '');
END;
Please give me any ideabro it is not working on string format coz of the missing quotes. e.g. 'smith' or smith. so the quoted string will be compared. in set_block_property u have to include extra quotes on the variable. e.g.
set_block_property('emp',default_where,'where ename='''||:emp.ename||'');
or with conditional statement
set_block_property('emp',default_where,'where ename='''||:emp.ename||''' and dname='''||dept.deptno||'');
there i included two extra qoutes before joining ename and in the an extra quote to complete to string. if u would like to debug at runtime to show if the qouted string condition is proper then assign the where clause to a variable and message it up.
like
myvariable:='where ename='''||:emp.ename||'';
message(myvariable);
message(myvariable);
set_block_property('emp',default_where,myvariable);
after the string is quoted properly the execute query will work fine, also use the function upper or lower to compare strings.
zaibi.
Maybe you are looking for
-
Master page Dynamic data not getting displayed in consecutive pages
Hi, I have buit a dynamic form which has some dynamic content in master page and a dynamic table in the body page. Layout is Master page Sub form Field1 -TextView Field2 - TextField bind with Node1--->Attribute
-
I previously had itunes on my computer uninstalled and now I want to reinstall it on my computer now and it keeps trying to install to a J drive instead of the C drive I have plenty of room on my computer but not on this "J" drive how can I change wh
-
I have been working on a video for awhile now and I've recently noticed that my .flv export format has been removed from my choice of encoders. I export from Poser Pro Game Dev to Png Image Sequence. I organise a cam angle in After Effects...I re ren
-
The text alignment boxes, top, middle, bottom, don't seem to affect change. I am accustomed to using multiple text boxes to customize more, and most of the time it works for me, but now I'm modifying an earlier pages doc where I just typed, and I'm r
-
Invoic inbound IDOC error.Please help!
Hello: When I posted AP document by IDOC triggerred by output RD04 in billing document, this inbound idoc always failed with error message:The transaction was terminated by the user. My message type is INVOIC. Do you know why this error happen