Fast tutorial for explain plan on Oracle

user1@testserver : /home/firestorm => sqlplus
 
SQL*Plus: Release 9.2.0.7.0 - Production on Wed Jul 2 15:27:33 2008
Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
 
Enter user-name: user1
Enter password: **********
 
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.7.0 - Production
 
dbserver:SQL> @?/rdbms/admin/utlxplan
 
dbserver:SQL> truncate table plan_table;
 
Table truncated.
 
dbserver:SQL> commit;
 
Commit complete.
 
dbserver:SQL> explain plan for
2  select count(*) from schemaname.tablename;
 
Explained.
 
dbserver:SQL> select * from table(dbms_xplan.display);
 
PLAN_TABLE_OUTPUT
-------------------------------------------------------------------------------------------------
 
--------------------------------------------------------------------------------------------------------
| Id  | Operation              |  Name            | Rows  | Bytes | Cost  |  TQ    |IN-OUT| PQ Distrib |
--------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT REMOTE|                  |     1 |       | 26979 |        |      |            |
|   1 |  SORT AGGREGATE        |                  |     1 |       |       |        |      |            |
|   2 |   SORT AGGREGATE       |                  |     1 |       |       | 20,00  | P->S | QC (RAND)  |
|   3 |    TABLE ACCESS FULL   | TABLENAME        |   309M|       | 26979 | 20,00  | PCWP |            |
--------------------------------------------------------------------------------------------------------
 
Note: fully remote operation, cpu costing is off
 
11 rows selected.
 
dbserver:SQL> exit;
FacebookTwitterGoogle+Share

Leave a Reply

Your email address will not be published. Required fields are marked *

CAPTCHA Image

*