TOAD HELP - Explain Plan
Hi,
I am using TOAD 8.0 for oracle 9i DB and new to toad
I had set the plan table for a schema say schema1@dev1 as follows
view>options>oracle>general>
explain plan table name -> TOAD_PLAN_TABLE
username -> xa11.....some blah blah that came by default
When i gave ctrl+e i got the execution plan
Now i connected as schema2@prod1 but when I try getting execution plan I get following error
ORA-00904: "PARTITION_STOP": invalid identifier
what should i do for this? the scema doesnt have DBA priv too.
Thanks ,
s
And please stop posting the same questions in
multiple forums.The reason is that - when a person doesn't get any proper solution he/she is keep looking for one easy solution which will solve his/her problem. As a result of that we may encounter same posting in multiple forum. I don't think it is unjustyfiable. Main reason is - somehow you need to solve the problem within schedule time. It is natural human behabiour. Though many user may disagree with me. This is completely my opinion.
I guess the best location for such a question would
be a TOAD forum.Indeed - if the user knows such forum. So, better give that link to this user. I hope you don't mind.
Regards.
Satyaki De.
Similar Messages
-
Hi when i run this in toad for explain plan its showing an error ORA_22905
hi when i run this query in toad for explain plan its showing an error ORA_22905 cannot accesss rows from an non nested table item can anyone help me out
SELECT
DISTINCT SERVICE_TBL.SERVICE_ID , SERVICE_TBL.CON_TYPE, SERVICE_TBL.S_DESC || '(' || SERVICE_TBL.CON_TYPE || ')' AS SERVICE_DESC ,SERVICE_TBL.CON_STAT
FROM
TABLE(:B1 )SERVICE_TBL
WHERE
CON_NUM = :B2
thanksNote the name of this forum is SQL Developer *(Not for general SQL/PLSQL questions)* (so for issues with the SQL Developer tool). Please post these questions under the dedicated SQL And PL/SQL forum.
Regards,
K. -
How can i paste the explain plan from toad..
Hello all
I tried taking a snap of the explain plan from toad but in this forum the paste option is disabled...please help964145 wrote:
I tried taking a snap of the explain plan from toad but in this forum the paste option is disabled...please helpI don't know, but it is a waste of time since explain plans from Toad are not useful.
Please read the forum FAQ on providing information for a tuning request, it describes how to generate an explain plan that can be shared.
{message:id=9360003}
This is an example.
SQL> explain plan for
2 select * from dual;
Explained.
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
Plan hash value: 3543395131
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 2 | 2 (0)| 00:00:01 |
| 1 | TABLE ACCESS FULL| DUAL | 1 | 2 | 2 (0)| 00:00:01 |
-------------------------------------------------------------------------- -
How to enable Explain plan in TOAD
Hi,
I am using toad version 8.6.1.Whenever i login as my userid and run a sql stmnt i am trying to get explain plan from toad explain plan button.But it's not showing anything some times it says insuffcient privileges.I created synonym called plan_table which is based on actual plan_table.But no luck.Can you pls help me how to enable explain plan in toad
Thanks
AnandAnand,
in earlier versions of Toad you could use the notoad.sql or toadprep.sql to create the required tables.
In your version it is probably already has been replaced by menu option Tools->Server Side Object Wizard.
Toad does not use the plan_table - it creates it's own set of tables including the table for the explain plan.
Mike -
I am trying to use TOAD to find the query performance. When I clicked on explain plan tab i get an error message: ORA-02404: specified plan table not found.
Can some one please tell me how to proceed from here so that I can check the explain plan for this tableI don't know how TOAD works with EXPLAIN PLAN, but mybe it is if you have PLAN_TABLE created in your database and granted all on it to public.
SQL> @<ORACLE_HOME>/rdbms/admin/utlxplan.sql
SQL> create public synonym plan_table for plan_table
SQL> grant all on plan_table to public
I don't know if you're looking for somethinkg like that ... -
Hi,
I was trying to get an explain plan for below query. (Refer - A)
BILL_DETAIL table have index of ZONECODE,MRNO,AREACODE,WCNO but still it's
showing 'TABLE ACCESS FULL in BILL_DETAIL'
If i select only first 4 column, it is going by index. (REFER - B)
As per my knowledge index will consider only where clause conditions
but here I couldn't understand why this considering select output columns.
First time I am trying sql explain plan statement, Please help me to correct
this query.
REFER - A
EXPLAIN PLAN FOR
SELECT B.ZONECODE ZONECODE, B.MRNO MRNO, B.AREACODE AREACODE, B.WCNO WCNO,
B.BILLNO BILLNO,B.BILLDT BILLDT,B.FROMDT FROMDT,B.TODT TODT,B.TOBEPAID TOBEPAID,
B.PREVUNPAID PREVUNPAID,B.DUEDT DUEDT
FROM BILL_DETAIL B, CONSUMER_MASTER C
WHERE B.ZONECODE = C.ZONECODE
AND B.MRNO = C.MRNO
AND B.AREACODE = C.AREACODE
AND B.WCNO = C.WCNO
AND UPPER(B.ZONECODE)=UPPER('SZ-4')
AND UPPER(B.MRNO)=UPPER('347')
AND UPPER(B.AREACODE)=UPPER('18')
AND UPPER(B.WCNO)=UPPER('30910')
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
| 0 | SELECT STATEMENT | | 1 | 71 | 9 (0)|
| 1 | NESTED LOOPS | | 1 | 71 | 9 (0)|
|* 2 | TABLE ACCESS FULL| BILL_DETAIL | 1 | 52 | 9 (0)|
|* 3 | INDEX UNIQUE SCAN| SYS_C008803 | 1 | 19 | 0 (0)|
Predicate Information (identified by operation id):
2 - filter(UPPER("B"."ZONECODE")='SZ-4' AND UPPER("B"."MRNO")='347'
AND UPPER("B"."AREACODE")='18' AND UPPER("B"."WCNO")='30910')
3 - access("B"."ZONECODE"="C"."ZONECODE" AND "B"."MRNO"="C"."MRNO"
AND "B"."AREACODE"="C"."AREACODE" AND "B"."WCNO"="C"."WCNO")
REFER - B
EXPLAIN PLAN FOR
SELECT B.ZONECODE ZONECODE, B.MRNO MRNO, B.AREACODE AREACODE, B.WCNO WCNO
FROM BILL_DETAIL B, CONSUMER_MASTER C
WHERE B.ZONECODE = C.ZONECODE
AND B.MRNO = C.MRNO
AND B.AREACODE = C.AREACODE
AND B.WCNO = C.WCNO
AND UPPER(B.ZONECODE)=UPPER('SZ-4')
AND UPPER(B.MRNO)=UPPER('347')
AND UPPER(B.AREACODE)=UPPER('18')
AND UPPER(B.WCNO)=UPPER('30910')
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
| 0 | SELECT STATEMENT | | 1 | 34 | 4 (0)|
| 1 | NESTED LOOPS | | 1 | 34 | 4 (0)|
|* 2 | INDEX FAST FULL SCAN| SYS_C008798 | 1 | 15 | 4 (0)|
|* 3 | INDEX UNIQUE SCAN | SYS_C008803 | 1 | 19 | 0 (0)|
Predicate Information (identified by operation id):
2 - filter(UPPER("B"."ZONECODE")='SZ-4' AND UPPER("B"."MRNO")='347'
AND UPPER("B"."AREACODE")='18' AND UPPER("B"."WCNO")='30910')
3 - access("B"."ZONECODE"="C"."ZONECODE" AND "B"."MRNO"="C"."MRNO"
AND "B"."AREACODE"="C"."AREACODE" AND "B"."WCNO"="C"."WCNO")
Note
- 'PLAN_TABLE' is old versionWelcome to the forums!
user13295080 wrote:
I was trying to get an explain plan for below query. (Refer - A)
BILL_DETAIL table have index of ZONECODE,MRNO,AREACODE,WCNO but still it's
showing 'TABLE ACCESS FULL in BILL_DETAIL'
If i select only first 4 column, it is going by index. (REFER - B)
As per my knowledge index will consider only where clause conditions
but here I couldn't understand why this considering select output columns.This is because Oracle is smart enough to know that the entire query can be satisfied by using the index without hitting the table. However, once you add a column that doesn't exist in the index Oracle has decided it is more efficient to use the full table scan.
I also noticed that all the row estimates are 1 in the execution plans. Is this expected? If not, have statistics on the relevant objects been gathered?
Generally speaking, when you have a query tuning question providing information in these threads is extremely helpful:
{message:id=1812597}
{thread:id=863295}
Additionally, when posting query plans, queries, or any code please use \ tags to preserve formatting.
Your code here!\ -
Need help understanding Explain Plan from 10046 trace
Below is a query and Explain Plan from a 10046 trace shown with trcanlzr.sql.
In the explain plan I don't understand what's happining at line ID 10 and 11. Specifically, is the result at line 11 rowids from lines 12 & 14? and then what? Are those rowids somehow used in line ID 10?
SELECT cp.cred_process_id, cp.provider_id,
brdg_credentialing.get_appl_specialist(cp.cred_process_id,'R') specialist_name,
brdg_cred_report_pkg.provider_name(cp.cred_process_id) provider_name,
ctc_apptype.description appl_type_desc,
TRUNC (brdg_credentialing.get_appl_received_dt(cp.cred_process_id)) init_received_dt,
brdg_code_util.code_descr(brdg_credentialing.get_appl_status_cd_ctc_id(cp.cred_process_id)) appl_status_desc,
brdg_credentialing.get_appl_prac_specialties(cp.cred_process_id,'Y') primary_specialty,
cwh.city practice_city,
UPPER (cwh.state) practice_state,
TRUNC (ch.event_dt) specialist_assign_dt,
DECODE (ctc_apptype.code,'INITPPO', TRUNC (brdg_credentialing.get_appl_received_dt(cp.cred_process_id)),
'REAPP', TRUNC (brdg_credentialing.get_appl_received_dt(cp.cred_process_id)),
'SPECCRED', TRUNC (brdg_credentialing.get_appl_received_dt(cp.cred_process_id)),
'TRANS', TRUNC (brdg_credentialing.get_appl_received_dt(cp.cred_process_id)),
'RECPPO', p.next_recred_dt,
'RECAPP', p.next_recred_dt, NULL) sort_date,
p.next_recred_dt
FROM brdg_cred_app_open_vw cp,
brdg_cat_type_codes ctc_apptype,
brdg_cred_work_history cwh,
brdg_cred_history ch,
brdg_providers p
WHERE cp.type_cd_ctc_id = ctc_apptype.cat_type_code_id
AND ctc_apptype.category_cd = 'CRED'
AND ctc_apptype.type_cd = 'APPTYPE'
AND cp.cred_process_id = cwh.cred_process_id (+)
AND cwh.primary_practice_flag (+) = 'Y'
AND cp.cred_process_id = ch.cred_process_id
AND ch.cred_history_id = (SELECT MAX(cred_history_id)
FROM brdg_cred_history
WHERE cred_process_id = cp.cred_process_id
AND event_cd_ctc_id = brdg_credentialing.get_event_ctc_id ('SEVENT','SPESTCHG'))
AND cp.provider_id = p.provider_id (+)
and brdg_credentialing.get_appl_specialist_id(cp.cred_process_id) = 5
ORDER BY 3 ASC, 3, 5, 12, 6
Explain Plan Operation
ID PID Card Rows Cost SearchCols / Indexed Cols Predicates
0: 1 36 SELECT STATEMENT
1: 0 1 139 36 SORT ORDER BY
2: 1 139 . FILTER [+]
3: 2 1 311 11 .. NESTED LOOPS OUTER
4: 3 1 311 10 ... NESTED LOOPS OUTER
5: 4 1 311 9 .... NESTED LOOPS
6: 5 1 311 8 ....+ NESTED LOOPS
7: 6 4 16 1 ....+. TABLE ACCESS BY INDEX ROWID CAT_TYPE_CODES
8: 7 4 16 1 ....+.. INDEX RANGE SCAN CAT_TYPE_CODE_UK 2/3 [+] [+]
9: 6 1 311 2 ....+. TABLE ACCESS BY INDEX ROWID CRED_PROCESSES [+]
10: 9 183 61927 1 ....+.. INDEX RANGE SCAN CDPR_CTCD_FK1 1/1 [+] [+]
11: 10 1 3 2 ....+... NESTED LOOPS
12: 11 1 16 1 ....+.... TABLE ACCESS BY INDEX ROWID CAT_TYPE_CODES
13: 12 1 16 1 ....+....+ INDEX UNIQUE SCAN CTCD_PK 1/1 [+] [+]
14: 11 1 3 1 ....+.... INDEX UNIQUE SCAN CAT_TYPE_CODE_UK 3/3 [+] [+]
15: 5 1 11 1 ....+ TABLE ACCESS BY INDEX ROWID CRED_HISTORY [+]
16: 15 1 311 1 ....+. INDEX UNIQUE SCAN CDHT_PK 1/1 [+] [+]
17: 16 1 311 ....+.. SORT AGGREGATE
18: 17 1 526 2 ....+... TABLE ACCESS BY INDEX ROWID CRED_HISTORY [+]
19: 18 23 9950 1 ....+.... INDEX RANGE SCAN CDHT_CDPR_FK 1/1 [+] [+]
20: 4 1 219 1 .... TABLE ACCESS BY INDEX ROWID PROVIDERS
21: 20 1 219 1 ....+ INDEX UNIQUE SCAN PROV_PK 1/1 [+] [+]
22: 3 1 311 1 ... TABLE ACCESS BY INDEX ROWID CRED_WORK_HISTORY [+]
23: 22 3 1057 1 .... INDEX RANGE SCAN CDWH_CDPR_FK 1/1 [+] [+]
24: 2 172 .. INLIST ITERATOR
25: 24 1 172 1 ... INDEX UNIQUE SCAN CAT_TYPE_CODE_UK 3/3 [+] [+]
26: 2 1 0 2 .. TABLE ACCESS BY INDEX ROWID CRED_HISTORY [+]
27: 26 23 2004 1 ... INDEX RANGE SCAN CDHT_CDPR_FK 1/1 [+] [+]
(1) X/Y: Where X is the number of searched columns from index, which has a total of Y columns.
(2) Actual rows returned by operation (average if there were more than 1 execution).
2 - filter( NOT EXISTS (SELECT 0 FROM "PPO"."CAT_TYPE_CODES" "BRDG_CAT_TYPE_CODES" WHERE
"CODE"="BRDG_CODE_UTIL"."ID_CODE"("BRDG_CREDENTIALING"."GET_APPL_STATUS_CD_CTC_ID"(:B1)) AND
("TYPE_CD"='APPROVAL' OR "TYPE_CD"='DENIED' OR "TYPE_CD"='INACTIVE' OR "TYPE_CD"='TERMED') AND
"CATEGORY_CD"='APPSTAT') AND NOT EXISTS (SELECT 0 FROM "PPO"."CRED_HISTORY" "BRDG_CRED_HISTORY"
WHERE "CRED_PROCESS_ID"=:B2 AND "EVENT_CD_CTC_ID"="BRDG_CODE_UTIL"."GET_ID"('CRED','SEVENT','MSODC
8 - access("CTC_APPTYPE"."CATEGORY_CD"='CRED' AND "CTC_APPTYPE"."TYPE_CD"='APPTYPE')
9 - filter("BRDG_CREDENTIALING"."GET_APPL_SPECIALIST_ID"("CP"."CRED_PROCESS_ID")=5 AND
("CP"."INS_DT">=TO_DATE(' 2007-12-20 17:00:00', 'syyyy-mm-dd hh24:mi:ss') OR
"CP"."TYPE_CD_CTC_ID"<>"BRDG_CODE_UTIL"."GET_ID"('CRED','APPTYPE','RECPPO')))
10 - access("CP"."TYPE_CD_CTC_ID"="CTC_APPTYPE"."CAT_TYPE_CODE_ID")
filter( NOT EXISTS (SELECT 0 FROM "PPO"."CAT_TYPE_CODES"
"CTC_APPTYPE","PPO"."CAT_TYPE_CODES" "CTC_TYPE" WHERE "CTC_TYPE"."CAT_TYPE_CODE_ID"=:B1 AND
"CTC_TYPE"."CODE"="CTC_APPTYPE"."CODE" AND "CTC_APPTYPE"."TYPE_CD"='APPSENT' AND
"CTC_APPTYPE"."CATEGORY_CD"='APPTYPE'))
13 - access("CTC_TYPE"."CAT_TYPE_CODE_ID"=:B1)
14 - access("CTC_APPTYPE"."CATEGORY_CD"='APPTYPE' AND "CTC_APPTYPE"."TYPE_CD"='APPSENT' AND
"CTC_TYPE"."CODE"="CTC_APPTYPE"."CODE")
15 - filter("CP"."CRED_PROCESS_ID"="CH"."CRED_PROCESS_ID")
16 - access("CH"."CRED_HISTORY_ID"= (SELECT MAX("CRED_HISTORY_ID") FROM "PPO"."CRED_HISTORY"
"BRDG_CRED_HISTORY" WHERE "CRED_PROCESS_ID"=:B1 AND
"EVENT_CD_CTC_ID"="BRDG_CREDENTIALING"."GET_EVENT_CTC_ID"('SEVENT','SPESTCHG')))
18 - filter("EVENT_CD_CTC_ID"="BRDG_CREDENTIALING"."GET_EVENT_CTC_ID"('SEVENT','SPESTCHG'))
19 - access("CRED_PROCESS_ID"=:B1)
21 - access("CP"."PROVIDER_ID"="P"."PROVIDER_ID"(+))
22 - filter("CWH"."PRIMARY_PRACTICE_FLAG"(+)='Y')
23 - access("CP"."CRED_PROCESS_ID"="CWH"."CRED_PROCESS_ID"(+))
25 - access("CATEGORY_CD"='APPSTAT' AND ("TYPE_CD"='APPROVAL' OR "TYPE_CD"='DENIED' OR
"TYPE_CD"='INACTIVE' OR "TYPE_CD"='TERMED') AND "CODE"="BRDG_CODE_UTIL"."ID_CODE"("BRDG_CREDENTIAL
ING"."GET_APPL_STATUS_CD_CTC_ID"(:B1)))
26 - filter("EVENT_CD_CTC_ID"="BRDG_CODE_UTIL"."GET_ID"('CRED','SEVENT','MSODC'))
27 - access("CRED_PROCESS_ID"=:B1)Welcome to the forums!
user11987210 wrote:
In the explain plan I don't understand what's happining at line ID 10 and 11. Specifically, is the result at line 11 rowids from lines 12 & 14? and then what? Are those rowids somehow used in line ID 10?
9: 6 1 311 2 ....+. TABLE ACCESS BY INDEX ROWID CRED_PROCESSES [+]
10: 9 183 61927 1 ....+.. INDEX RANGE SCAN CDPR_CTCD_FK1 1/1 [+] [+]
11: 10 1 3 2 ....+... NESTED LOOPS
12: 11 1 16 1 ....+.... TABLE ACCESS BY INDEX ROWID CAT_TYPE_CODES
13: 12 1 16 1 ....+....+ INDEX UNIQUE SCAN CTCD_PK 1/1 [+] [+]
14: 11 1 3 1 ....+.... INDEX UNIQUE SCAN CAT_TYPE_CODE_UK 3/3 [+] [+] The NESTED LOOPS operation (ID #11) has two children, ID #12 sometimes called the driving source, and ID #14 the inner loop. ID #14 is executed once for each row returned by ID #12. The results of ID #11 are then fed to ID #10 which performs an INDEX RANGE SCAN.
Hope this helps! -
Not able to use EXPLAIN PLAN in Toad
hi,
I am not able to use Explain Plan in Toad. The error it gives is the table PLAN_TABLE doesn't exit.
But after seeing this error I did run the script "UTLXPLAN.sql" in order to create the plan_table table.
After installing the above table I am not able to use EXPLAIN_PLAN from toad, Its giving same error Table PLAN_TABLE doesn't exit though i created it successfully in the proper schema.
Thanks in advance
Ramcheck and post.
SQL> select owner from dba_tables where table_name='PLAN_TABLE';
before using toad ,first u should connect to sqlplus by that user and issue
SET AUTOTRACE ON.
Kuljeet -
Help to understand the explain plan
Hi, Everyone,
i have query :
INSERT INTO ICM_UPSEL_1_ALL
select a.customer_no,a.pr_code_bbl,min(b.pr_code_pmm) pr_code_pmm,a.score,a.price_diff,a.flag
from ICM_UPSEL_MIN_PRDIFF_1 a, icm_pre b
where a.customer_no = b.customer_no
and a.pr_code_bbl=b.pr_code_bbl
and a.score = b.score
and a.flag = b.flag
and a.price_diff = b.price_diff
and b.price_diff > 0
and b.score >=0.5
and b.flag = 1
and b.price_diff > 0 and b.price_diff <= 10
group by a.customer_no,a.pr_code_bbl,a.score,a.price_diff,a.flag
This query is running in a pl/sql procedure. The explain plan for this query is :
Plan hash value: 3124235498
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | INSERT STATEMENT | | 1 | 143 | 4 (25)| 00:00:01 |
| 1 | LOAD TABLE CONVENTIONAL | ICM_UPSEL_1_ALL | | | | |
| 2 | HASH GROUP BY | | 1 | 143 | 4 (25)| 00:00:01 |
| 3 | NESTED LOOPS | | | | | |
| 4 | NESTED LOOPS | | 1 | 143 | 3 (0)| 00:00:01 |
|* 5 | TABLE ACCESS BY INDEX ROWID| ICM_UPSEL_MIN_PRDIFF_1 | 1 | 65 | 1 (0)| 00:00:01 |
|* 6 | INDEX RANGE SCAN | MPD_1_FLAG_IDX | 1 | | 1 (0)| 00:00:01 |
|* 7 | INDEX RANGE SCAN | ICM_PRE_FLAG_IDX | 1 | | 2 (0)| 00:00:01 |
|* 8 | TABLE ACCESS BY INDEX ROWID | ICM_PRE | 1 | 78 | 2 (0)| 00:00:01 |
Predicate Information (identified by operation id):
5 - filter("A"."PRICE_DIFF">0 AND "A"."SCORE">=0.5 AND "A"."PRICE_DIFF"<=10)
6 - access("A"."FLAG"=1)
7 - access("B"."FLAG"=1)
8 - filter("B"."PRICE_DIFF"<=10 AND "B"."SCORE">=0.5 AND "B"."PRICE_DIFF">0 AND
"A"."CUSTOMER_NO"="B"."CUSTOMER_NO" AND "A"."PR_CODE_BBL"="B"."PR_CODE_BBL" AND "A"."SCORE"="B"."SCORE"
AND "A"."PRICE_DIFF"="B"."PRICE_DIFF")
This query is running for 10 hours now and no result yet. Could anyone please help me where is going wrong... why is it taking so much time to insert the data...
The number of rows in ICM_UPSEL_MIN_PRDIFF_1 : 84,858
The number of rows in icm_pre : 455,500,944
All the columns are indexed.
My database version is 11.1.0.6 running on windows server 2003 R2.
Thanks in advanceHi, Nikolay,
Please see the results below;
SELECT * FROM DBA_TAB_COL_STATISTICS
WHERE OWNER = 'SAST' AND TABLE_NAME = 'ICM_UPSEL_MIN_PRDIFF_1' AND COLUMN_NAME = 'FLAG';
TABLE_NAME
COLUMN_NAME
NUM_DISTINCT
LOW_VALUE
HIGH_VALUE
DENSITY
NUM_NULLS
NUM_BUCKETS
LAST_ANALYZED
SAMPLE_SIZE
GLOBAL_STATS
USER_STATS
AVG_COL_LEN
HISTOGRAM
SAST ICM_UPSEL_MIN_PRDIFF_1 FLAG 1 C102 C102 0.00000584543291182618 0 1 16/07/13 10:01:42 5544 YES NO 3 FREQUENCY
SELECT * FROM DBA_TAB_STATISTICS WHERE OWNER = 'SAST' AND TABLE_NAME = 'ICM_UPSEL_MIN_PRDIFF_1';
TABLE_NAME
PARTITION_NAME
PARTITION_POSITION
SUBPARTITION_NAME
SUBPARTITION_POSITION
OBJECT_TYPE
NUM_ROWS
BLOCKS
EMPTY_BLOCKS
AVG_SPACE
CHAIN_CNT
AVG_ROW_LEN
AVG_SPACE_FREELIST_BLOCKS
NUM_FREELIST_BLOCKS
AVG_CACHED_BLOCKS
AVG_CACHE_HIT_RATIO
SAMPLE_SIZE
LAST_ANALYZED
GLOBAL_STATS
USER_STATS
STATTYPE_LOCKED
STALE_STATS
SAST ICM_UPSEL_MIN_PRDIFF_1
TABLE 84858 874 0 0 0 62 0 0
84858 16/07/13 10:02:00 YES NO
NO
Thanks & Regards
Su -
Unable to generate explain plan from toad
HI,
Toad Version:8.6
I was unable to generate the explain plan in the toad.Here i create PLAN_TOAD table also but it is still getting the same error
ORA-00942: table or view does not existHello,
You created the Table PLAN_TABLE but you must check the configuration of TOAD.
It seems to me that by default TOAD use the Table TOAD_PLAN_TABLE.
So, you must set the right name of the Table (or rename the Table PLAN_TABLE).
Best regards,
Jean-Valentin Lubiez -
Hi,
I understand that reading output of an explain starts from the mostly indented lines.
Anyhow in TOAD (I am using version 9.7) toad Adds a number before each line in the explain plan tree. This number looks random to me because I cannot link it to the execution plan as per indentation.
Can anybody tell me what this number before each line is ?
Thanks
AKaskanaan wrote:
I understand that reading output of an explain starts from the mostly indented lines.
...Though this may "sometimes" be so, it is certainly not a general rule. It all depends on the (parent) operations that preceed/follow that "mostly indented line".
Here's a simple counter-example using the emp/dept tables.
1 explain plan for
2 select d.deptno
3 ,d.dname
4 ,(select count(*)
5 from emp e
6 where e.deptno=d.deptno) as count_emp
7* from dept d
SQL> /
Explained.
SQL> @vp
More...
PLAN_TABLE_OUTPUT
Plan hash value: 4111639169
| Id | Operation | Name | Rows | Bytes |
| 0 | SELECT STATEMENT | | 1 | 22 |
| 1 | SORT AGGREGATE | | 1 | 13 |
|* 2 | TABLE ACCESS FULL| EMP | 1 | 13 |
| 3 | TABLE ACCESS FULL | DEPT | 1 | 22 |
Predicate Information (identified by operation id):
2 - filter("E"."DEPTNO"=:B1)This plan starts at line 3. Not 2, which is the "mostly indented line".
Here's another one:
1 explain plan for
2 select d.*
3 from emp e
4 ,(select d1.deptno
5 from dept d1
6 where d1.loc in (select d2.loc
7 from dept d2
8 group by d2.loc
9 having count(*) > 1)) d
10* where e.deptno = d.deptno
SQL> /
Explained.
SQL> @vp
More...
PLAN_TABLE_OUTPUT
Plan hash value: 1621130288
| Id | Operation | Name |
| 0 | SELECT STATEMENT | |
| 1 | NESTED LOOPS SEMI | |
| 2 | NESTED LOOPS | |
| 3 | TABLE ACCESS FULL | EMP |
| 4 | TABLE ACCESS BY INDEX ROWID| DEPT |
|* 5 | INDEX UNIQUE SCAN | SYS_C00204096 |
|* 6 | VIEW | VW_NSO_1 |
|* 7 | FILTER | |
| 8 | SORT GROUP BY | |
| 9 | TABLE ACCESS FULL | DEPT |
Predicate Information (identified by operation id):
5 - access("E"."DEPTNO"="D1"."DEPTNO")
6 - filter("D1"."LOC"="$nso_col_1")
7 - filter(COUNT(*)>1)If you think this one starts at line 9, you're wrong again. It starts at line 3.
You need to understand all the "operations" that can appear in an execution plan.
Only then can you deduce where the execution of such plan really starts.
Toon -
Able to execute a query in TOAD but can't ceate explain plan
Hi,
I can execute a query in TOAD which uses table from other schema. I have created the synonym and given the rights on it.
But when I try to create explain plan using TOAD: I get Ora-00942:Table or view does not exist.
Any suggestions..
Thanks..user8941550 wrote:
But if I just try
Explain Plan for
select t.xml_msg_text
from xml_tbl t
THen this works.That will have to be executed as a script in TOAD, which essentially shells out to use SQL*Plus and capture the output, so it's not Toads in-built explain plan.
In another schema I can generate the plan.So that other schema has been set up with toads explain plan table.
In TOAD look in Database -> Administer -> Server Side Objects Wizard
and follow that through to create the necessary toad objects on the server. -
Please help to understand 10g explain plan
Hello
I am trying to optimize one query. I have taken explain plan of this query in 9i and 10g database both.
Explain plan for index scan is different in 9i and 10g. In 9i inedex was scaned with INDEX RANGE SCAN NON-UNIQUE and in 10g index is scanned with
INDEX RANGE SCAN.
Can anybody explain the difference of scanning an index in 9i and 10g? Cost in 9i was 74 and now in 10g it is 1134.
Thanks in advanceWell, if you tables structures and indexes are the same in both databases then that's unlikely to be an issue, however you need to check other factors such as whether statistics have been gathered for the data recently.
For helpful info on optimising queries and what to look out for read the following thread...
[When your query takes too long|http://forums.oracle.com/forums/thread.jspa?messageID=1812597#1812597] -
Help with interpreting explain plan (dbms_xplan) output
Hi all,
I'm trying to get to grips with reading and interpreting the explain plan or dbms_xplan output, and so I hope someone can help with the output below.
So, with the explain shown below, does it mean that...
a) it starts with step 8 and sends all rows to the nested loop in step 5
b) it only sends (or thinks it sends) 1 row to step 5 from step 8
c) For each row supplied from step 5, there will be an index lookup at step 8 to access the table at step 6
d) Step 8 only gets (or think it gets) 1 row
If it does mean that only 1 row is expected by the optimizer, and yet the full table scan should return 150,000 records, and the table has up to date statistiucs, what else would cause the cardinality to be so far off?
If it doesn't mean it will return 1 row then what does it mean ?
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | | | 945 (100)| |
| 1 | SORT GROUP BY | | 1 | 283 | 945 (3)| 00:00:05 |
|* 2 | FILTER | | | | | |
| 3 | NESTED LOOPS | | | | | |
| 4 | NESTED LOOPS | | 1 | 283 | 944 (3)| 00:00:05 |
| 5 | NESTED LOOPS | | 1 | 108 | 929 (3)| 00:00:05 |
|* 6 | MAT_VIEW ACCESS FULL | DEMOGRAPHICS_MV | 1 | 97 | 927 (3)| 00:00:05 |
|* 7 | MAT_VIEW ACCESS BY INDEX ROWID| NAMES_MV | 1 | 11 | 2 (0)| 00:00:01 |
|* 8 | INDEX RANGE SCAN | ORG_MV_IDX1 | 1 | | 1 (0)| 00:00:01 |
|* 9 | INDEX RANGE SCAN | PAY_IDX8 | 252 | | 4 (0)| 00:00:01 |
|* 10 | TABLE ACCESS BY INDEX ROWID | PAY_ALL | 1 | 175 | 15 (0)| 00:00:01 |
Predicate Information (identified by operation id):
8 - access("ORG_MV"."ORG_ID"="DEMO_MV"."ORG_ID")Many thanks for your help.Thank you Hemant and rp0428,
I read through that white paper which was really useful.
I ran query using GATHER_PLAN_STATISTICS and go tthe Estimate and Actual rows - wow - it is a long way out!!
| Id | Operation | Name | Starts | E-Rows |E-Bytes| Cost (%CPU)| E-Time | A-Rows | A-Time | Buffers | Reads | OMem | 1Mem | Used-Mem |
| 0 | SELECT STATEMENT | | 1 | | | 945 (100)| | 0 |00:18:11.39 | 2552K| 361K| | | |
| 1 | SORT GROUP BY | | 1 | 1 | 283 | 945 (3)| 00:00:05 | 0 |00:18:11.39 | 2552K| 361K| 1024 | 1024 | |
|* 2 | FILTER | | 1 | | | | | 0 |00:18:11.39 | 2552K| 361K| | | |
| 3 | NESTED LOOPS | | 1 | | | | | 0 |00:18:11.39 | 2552K| 361K| | | |
| 4 | NESTED LOOPS | | 1 | 1 | 283 | 944 (3)| 00:00:05 | 44M|00:04:59.03 | 598K| 63442 | | | |
| 5 | NESTED LOOPS | | 1 | 1 | 108 | 929 (3)| 00:00:05 | 109K|00:00:01.73 | 7807 | 7 | | | |
|* 6 | MAT_VIEW ACCESS FULL | DEMOGRAPHICS_MV | 1 | 1 | 97 | 927 (3)| 00:00:05 | 126K|00:00:00.26 | 5417 | 1 | | | |
|* 7 | MAT_VIEW ACCESS BY INDEX ROWID| NAMES_MV | 126K| 1 | 11 | 2 (0)| 00:00:01 | 109K|00:00:01.27 | 2390 | 6 | | | |
|* 8 | INDEX RANGE SCAN | ORG_MV_IDX1 | 126K| 1 | | 1 (0)| 00:00:01 | 126K|00:00:00.69 | 2023 | 6 | | | |
|* 9 | INDEX RANGE SCAN | PAY_IDX8 | 109K| 252 | | 4 (0)| 00:00:01 | 44M|00:04:03.07 | 590K| 63435 | | | |
|* 10 | TABLE ACCESS BY INDEX ROWID | PAY_ALL | 44M| 1 | 175 | 15 (0)| 00:00:01 | 0 |00:13:09.85 | 1954K| 297K| | | |
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------When I unravel the WHERE clause and remove the decode(nvl statements (which only evaluate the passed in parameters and provide default values where they are NULL) I get a much better plan and values
| Id | Operation | Name | Starts | E-Rows |E-Bytes| Cost (%CPU)| E-Time | A-Rows | A-Time | Buffers | Reads | OMem | 1Mem | Used-Mem |
| 0 | SELECT STATEMENT | | 1 | | | 157K(100)| | 0 |00:00:43.10 | 343K| 45190 | | | |
| 1 | SORT GROUP BY | | 1 | 1 | 283 | 157K (1)| 00:13:47 | 0 |00:00:43.10 | 343K| 45190 | 1024 | 1024 | |
| 2 | NESTED LOOPS | | 1 | | | | | 0 |00:00:43.10 | 343K| 45190 | | | |
| 3 | NESTED LOOPS | | 1 | 1 | 283 | 157K (1)| 00:13:47 | 0 |00:00:43.10 | 343K| 45190 | | | |
|* 4 | HASH JOIN | | 1 | 1 | 272 | 157K (1)| 00:13:47 | 0 |00:00:43.10 | 343K| 45190 | 720K| 720K| 171K (0)|
|* 5 | TABLE ACCESS BY INDEX ROWID | PAY_ALL | 1 | 2 | 350 | 156K (1)| 00:13:43 | 0 |00:00:43.10 | 343K| 45190 | | | |
|* 6 | INDEX RANGE SCAN | PAY_IDX7 | 1 | 3596K| | 15565 (1)| 00:01:22 | 7251K|00:00:50.88 | 45190 | 45190 | | | |
|* 7 | MAT_VIEW ACCESS FULL | DEMOGRAPHICS_MV | 0 | 126K| 11M| 919 (2)| 00:00:05 | 0 |00:00:00.01 | 0 | 0 | | | |
|* 8 | INDEX RANGE SCAN | ORG_MV_IDX1 | 0 | 1 | | 1 (0)| 00:00:01 | 0 |00:00:00.01 | 0 | 0 | | | |
|* 9 | MAT_VIEW ACCESS BY INDEX ROWID| NAMES_MV | 0 | 1 | 11 | 2 (0)| 00:00:01 | 0 |00:00:00.01 | 0 | 0 | | | |
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Even though the result set is zero, the time to establish this came down from 35 minutes to 30 seconds and the plan has changed and is using a different index now!
Thanks for your help! -
Help needed in explain plan?
Hi,
Can anyone send me good link to learn explain plan..Hi,
Please check [Tuning SQL Statements Using Explain Plan|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:231814117467] and [19 Using EXPLAIN PLAN|http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/ex_plan.htm#i19260] (for 10.2, but there is similar information for other versions in the correlated manual), I hope it can help you.
Regards,
Maybe you are looking for
-
Interface Builder failure during ObjCTutorial.pdf
Page 43 of ObjCTutorial.pdf has me add an object to the xib. Tutorial says to change the class to ConverterController in the Inspector identity tab. No prob. Says "The class actions and class outlets are filled-in to match the outlets and actions you
-
Hello. I need a many problems when I deploy application from ear file on standalone server (weblogic). My application was create on jdev 11.1.1.2.0. I have application, which I deployed on server. http://dema-rew.narod.ru/2.jpg Appllication name is m
-
XPath function failed in XSLT (OSB 10.3.1)
Platform : OSB 10.3.1 in Windows XP Error : Test following XSLT scripts in OSB Console by getting error Error executing the XSLT transformation: java.lang.NoSuchMethodException: For extension function, could not find method weblogic.apache.xpath.axes
-
using: 10.1.2, WebLogic 8.1sp4, Solaris 9 I am trying to invoke an ejb directly via the WSIF. I can get the sample working but when I try to get my real stuff working I get the following exception: [having the default.collaxa.cube.ws logging set to D
-
How to configure Gamil SMTP in Project Server?
In Project Server Alert Settings, I could notice only "smtp Server" , "port" and "from email" only, I want to use my "Gmail" or "Sendgrid" smtp setting in epm. In order to use those accounts i need a place to key in the account password. But i don't