autotrace ansi full outer join : autotrace « SQL Plus « Oracle PL / SQL

Oracle PL / SQL
1. Aggregate Functions
2. Analytical Functions
3. Char Functions
4. Constraints
5. Conversion Functions
6. Cursor
7. Data Type
8. Date Timezone
9. Hierarchical Query
10. Index
11. Insert Delete Update
12. Large Objects
13. Numeric Math Functions
14. Object Oriented Database
15. PL SQL
16. Regular Expressions
17. Report Column Page
18. Result Set
19. Select Query
20. Sequence
21. SQL Plus
22. Stored Procedure Function
23. Subquery
24. System Packages
25. System Tables Views
26. Table
27. Table Joins
28. Trigger
29. User Previliege
30. View
31. XML
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Oracle PL / SQL » SQL Plus » autotrace 
autotrace ansi full outer join
  

SQL>
SQL>
SQL> create table myTable as
  2  select  'myTable' as C1
  3   ,OBJECT_NAME
  4   ,SUBOBJECT_NAME
  5   ,OBJECT_ID
  6   ,DATA_OBJECT_ID
  7   ,OBJECT_TYPE
  8   ,CREATED
  9   ,LAST_DDL_TIME
 10   ,TIMESTAMP
 11   ,STATUS
 12   ,TEMPORARY
 13   ,GENERATED
 14   ,SECONDARY
 15  from dba_objects;

Table created.

SQL>
SQL> create table myTable2 as
  2  select  'myTable2' as C1
  3   ,OBJECT_NAME  || 'myTable2' as object_name
  4   ,SUBOBJECT_NAME
  5   ,OBJECT_ID
  6   ,DATA_OBJECT_ID
  7   ,OBJECT_TYPE
  8   ,CREATED
  9   ,LAST_DDL_TIME
 10   ,TIMESTAMP
 11   ,STATUS
 12   ,TEMPORARY
 13   ,GENERATED
 14   ,SECONDARY
 15  from dba_objects
 16  where rownum <= 10000;

Table created.

SQL>
SQL> create index myTable_object_id on myTable (object_id);

Index created.

SQL>
SQL> create index myTable2_object_id on myTable2 (object_id);

Index created.

SQL>
SQL> analyze table myTable compute statistics;

Table analyzed.

SQL>
SQL> analyze table myTable2 compute statistics;

Table analyzed.

SQL>
SQL> set autotrace TRACEONLY
SQL> set timing on
SQL> select *
  2  from myTable a, myTable2 b
  3  where a.object_id = b.object_id(+)
  4  union
  5  select *
  6  from myTable a, myTable2 b
  7  where a.object_id(+= b.object_id;

13158 rows selected.

Elapsed: 00:00:00.62

Execution Plan
----------------------------------------------------------
Plan hash value: 4186416997

---------------------------------------------------------------------------------------------
| Id  | Operation                      | Name               | Rows  | Bytes |TempSpc| Cost  |
---------------------------------------------------------------------------------------------
|   SELECT STATEMENT               |                    | 23158 |  4296K|       | 47039 |
|   |  SORT UNIQUE                   |                    | 23158 |  4296K|    10M| 47039 |
|   |   UNION-ALL                    |                    |       |       |       |       |
|   |    NESTED LOOPS OUTER          |                    | 13158 |  2441K|       | 26343 |
|   |     TABLE ACCESS FULL          | MYTABLE            | 13158 |  1169K|       |    27 |
|   |     TABLE ACCESS BY INDEX ROWID| MYTABLE2           |     |    99 |       |     |
|*  |      INDEX RANGE SCAN          | MYTABLE2_OBJECT_ID |     |       |       |     |
|   |    NESTED LOOPS OUTER          |                    | 10000 |  1855K|       | 20022 |
|   |     TABLE ACCESS FULL          | MYTABLE2           | 10000 |   966K|       |    22 |
|   |     TABLE ACCESS BY INDEX ROWID| MYTABLE            |     |    91 |       |     |
|* 10 |      INDEX RANGE SCAN          | MYTABLE_OBJECT_ID  |     |       |       |     |
---------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   - access("A"."OBJECT_ID"="B"."OBJECT_ID"(+))
  10 - access("A"."OBJECT_ID"(+)="B"."OBJECT_ID")

Note
-----
   - cpu costing is off (consider enabling it)


Statistics
----------------------------------------------------------
          1  recursive calls
          0  db block gets
      43520  consistent gets
          0  physical reads
          0  redo size
    1301014  bytes sent via SQL*Net to client
      10027  bytes received via SQL*Net from client
        879  SQL*Net roundtrips to/from client
          1  sorts (memory)
          0  sorts (disk)
      13158  rows processed

SQL>
SQL>
SQL> select *
  2  from myTable a full outer join myTable2 b
  3  using (object_id);

13158 rows selected.

Elapsed: 00:00:00.52

Execution Plan
----------------------------------------------------------
Plan hash value: 3236823177

-------------------------------------------------------------------------------------
| Id  | Operation                      | Name               | Rows  | Bytes | Cost  |
-------------------------------------------------------------------------------------
|   SELECT STATEMENT               |                    | 13658 |  4401K| 26365 |
|   |  VIEW                          |                    | 13658 |  4401K| 26365 |
|   |   UNION-ALL                    |                    |       |       |       |
|   |    NESTED LOOPS OUTER          |                    | 13158 |  2441K| 26343 |
|   |     TABLE ACCESS FULL          | MYTABLE            | 13158 |  1169K|    27 |
|   |     TABLE ACCESS BY INDEX ROWID| MYTABLE2           |     |    99 |     |
|*  |      INDEX RANGE SCAN          | MYTABLE2_OBJECT_ID |     |       |     |
|*  |    FILTER                      |                    |       |       |       |
|   |     TABLE ACCESS FULL          | MYTABLE2           |   500 49500 |    22 |
|*  |     INDEX RANGE SCAN           | MYTABLE_OBJECT_ID  |     |    13 |     |
-------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   - access("A"."OBJECT_ID"="B"."OBJECT_ID"(+))
   - filterNOT EXISTS (SELECT /*+ UNNEST */ FROM "MYTABLE" "A" WHERE
              "A"."OBJECT_ID"=:B1))
   - access("A"."OBJECT_ID"=:B1)

Note
-----
   - cpu costing is off (consider enabling it)


Statistics
----------------------------------------------------------
          1  recursive calls
          0  db block gets
      45912  consistent gets
          0  physical reads
          0  redo size
     956084  bytes sent via SQL*Net to client
      10027  bytes received via SQL*Net from client
        879  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
      13158  rows processed

SQL>
SQL> set timing off
SQL> set autotrace off
SQL>
SQL>
SQL> drop table myTable;

Table dropped.

SQL>
SQL> drop table myTable2;

Table dropped.

   
    
  
Related examples in the same category
1. autotrace command
2. Autotrace on and off
3. Autotrace lower text function
4. Autotrace running total
5. Autotrace a query on a huge table
6. Autotrace a large table
7. Autotrace a query with group clause
8. Execution Plan
9. autotrace a nested query
10. set autotrace on explain for every single statement
11. set autotrace traceonly explain for bitmap index
12. set autotrace traceonly explain, and condition
13. set autotrace traceonly statistics
14. set autotrace traceonly statistics for 'select * from tableName'
15. set autotrace traceonly
16. AUTOTRACE exists (subquery)
17. AUTOTRACE table joining
18. AUTOTRACE table joining and aggregate function
19. autotrace count(*)
20. autotrace ctxsys.context index
21. autotrace merge command
22. autotrace table with/without an index
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.