![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Why does the statistics report in the explain plan take more time to be generated? When I use "set autotrace traceonly explain", it takes zero seconds for the plan to be generated. If the autotrace is set to "set autotrace traceonly explain statistics" then it takes 14 seconds. Any idea why this happens? SQL> desc test_p Name Null? Type ----------------------------------------- -------- ----------------- MYCOL1 NUMBER SQL> truncate table test_p; Table truncated. Elapsed: 00:00:00.00 SQL> set autotrace traceonly explain SQL> select * from test_p; Elapsed: 00:00:00.00 Execution Plan ---------------------------------------------------------- 0 SELECT STATEMENT Optimizer=CHOOSE 1 0 TABLE ACCESS (FULL) OF 'TEST_P' SQL> set autotrace traceonly explain statistics SQL> / no rows selected Elapsed: 00:00:14.04 Execution Plan ---------------------------------------------------------- 0 SELECT STATEMENT Optimizer=CHOOSE 1 0 TABLE ACCESS (FULL) OF 'TEST_P' Statistics ---------------------------------------------------------- 0 recursive calls 0 db block gets 3 consistent gets 0 physical reads 0 redo size 140 bytes sent via SQL*Net to client 232 bytes received via SQL*Net from client 1 SQL*Net roundtrips to/from client 0 sorts (memory) 0 sorts (disk) 0 rows processed |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
I agree that there might be a slight overhead in collecting the statisitcs of a query. But I am concerned with the amount of time taken. There must be something wrong with the session. I am looking for some clues. |
#5
| |||
| |||
|
|
Prasath wrote: I agree that there might be a slight overhead in collecting the statisitcs of a query. But I am concerned with the amount of time taken. There must be something wrong with the session. I am looking for some clues. Oracle docs are your friend http://download-east.oracle.com/docs...3/autotrac.htm SET AUTOTRACE ON EXPLAIN The AUTOTRACE report shows only the optimizer execution path. Only plan, no actual execute of query, therefore such a difference. Gints Plivna http://www.gplivna.eu/ |
#6
| |||
| |||
|
|
"Gints Plivna" <gints.plivna (AT) gmail (DOT) com> a écrit dans le message de news: 1153137348.573607.108590 (AT) m79g20...oglegroups.com... | Prasath wrote: | > I agree that there might be a slight overhead in collecting the | > statisitcs of a query. But I am concerned with the amount of time | > taken. There must be something wrong with the session. I am looking | > for some clues. | | Oracle docs are your friend | http://download-east.oracle.com/docs...3/autotrac.htm | | SET AUTOTRACE ON EXPLAIN | The AUTOTRACE report shows only the optimizer execution path. | | Only plan, no actual execute of query, therefore such a difference. | | Gints Plivna | http://www.gplivna.eu/ | Wrong! There is no result output but the query is executed. Regards Michel Cadot |
#7
| |||
| |||
|
|
"Gints Plivna" <gints.plivna (AT) gmail (DOT) com> a écrit dans le message de news: 1153137348.573607.108590 (AT) m79g20...oglegroups.com... | Prasath wrote: | > I agree that there might be a slight overhead in collecting the | > statisitcs of a query. But I am concerned with the amount of time | > taken. There must be something wrong with the session. I am looking | > for some clues. | | Oracle docs are your friend | http://download-east.oracle.com/docs...3/autotrac.htm | | SET AUTOTRACE ON EXPLAIN | The AUTOTRACE report shows only the optimizer execution path. | | Only plan, no actual execute of query, therefore such a difference. | | Gints Plivna | http://www.gplivna.eu/ | Wrong! There is no result output but the query is executed. Regards Michel Cadot |
#8
| |||
| |||
|
|
I think you meant SET AUTOTRACE TRACEONLY EXPLAIN and not SET AUTOTRACE ON EXPLAIN as you posted. Regards Michel Cadot |

![]() |
| Thread Tools | |
| Display Modes | |
| |