Solve the problem that autotrace does not display Predicate Information

Source: Internet
Author: User

With autotrace, you can see the Predicate Information in some databases. Sometimes you cannot see it because the plan_table version is old. The solution is as follows:

SQL> set autotrace traceonly

SQL> select u. name
2 from user u
3 where u. department_id in (select d. department_id from department d );

Execution Plan
-----------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (% CPU) |
-----------------------------------------------------------------------------
| 0 | select statement | 5251 | 89267 | 15 (7) |
| 1 | nested loops | 5251 | 89267 | 15 (7) |
| 2 | table access full | USER | 5273 | 63276 | 14 (0) |
| 3 | index unique scan | PK_DEPARTMENT | 1 | 5 | 0 (0) |
-----------------------------------------------------------------------------
Note
-----
-'Plan _ table' is old version
Statistics
----------------------------------------------------------
1 recursive cballs
0 db block gets
6024 consistent gets
0 physical reads
0 redo size
72158 bytes sent via SQL * Net to client
4156 bytes encoded ed via SQL * Net from client
348 SQL * Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
5195 rows processed

Solution:
Drop table PLAN_TABLE;
@? /Rdbms/admin/utlxplan

SQL> select u. name
2 from user u
3 where u. department_id in (select d. department_id from department d );

Execution Plan
----------------------------------------------------------
Plan hash value: 2264021098

Bytes ----------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (% CPU) | Time |
Bytes ----------------------------------------------------------------------------------------
| 0 | select statement | 5251 | 89267 | 15 (7) | 00:00:01 |
| 1 | nested loops | 5251 | 89267 | 15 (7) | 00:00:01 |
| 2 | table access full | USER | 5273 | 63276 | 14 (0) | 00:00:01 |
| * 3 | index unique scan | PK_DEPARTMENT | 1 | 5 | 0 (0) | 00:00:01 |
Bytes ----------------------------------------------------------------------------------------
Predicate Information (identified by operation id ):
---------------------------------------------------
3-access ("U". "DEPARTMENT_ID" = "D". "DEPARTMENT_ID ")

Statistics
----------------------------------------------------------
0 recursive cballs
0 db block gets
6024 consistent gets
0 physical reads
0 redo size
72158 bytes sent via SQL * Net to client
4156 bytes encoded ed via SQL * Net from client
348 SQL * Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
5195 rows processed

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.