To generate the cost for the query based on single table or a group of table pls follow the below syntax in TOAD / SQL Developer,
Step 1:
EXPLAIN PLAN FOR
select * from ap_suppliers;
Result =>
Explained.
Step 2:
select plan_table_output from table(dbms_xplan.display('plan_table',null,'basic'));
Result =>
------------------------------------------
| Id | Operation | Name |
------------------------------------------
| 0 | SELECT STATEMENT | |
| 1 | TABLE ACCESS FULL| AP_SUPPLIERS |
------------------------------------------
Step 3:
select plan_table_output from table(dbms_xplan.display_cursor(null,null,'basic'));
Result =>
EXPLAINED SQL STATEMENT:
------------------------
select plan_table_output from table(dbms_xplan.display('plan_table',null
,'basic'))
Plan hash value: 2137789089
-----------------------------------------------------
| Id | Operation | Name |
-----------------------------------------------------
| 0 | SELECT STATEMENT | |
| 1 | COLLECTION ITERATOR PICKLER FETCH| DISPLAY |
-----------------------------------------------------
Step 1:
EXPLAIN PLAN FOR
select * from ap_suppliers;
Result =>
Explained.
Step 2:
select plan_table_output from table(dbms_xplan.display('plan_table',null,'basic'));
Result =>
------------------------------------------
| Id | Operation | Name |
------------------------------------------
| 0 | SELECT STATEMENT | |
| 1 | TABLE ACCESS FULL| AP_SUPPLIERS |
------------------------------------------
Step 3:
select plan_table_output from table(dbms_xplan.display_cursor(null,null,'basic'));
Result =>
EXPLAINED SQL STATEMENT:
------------------------
select plan_table_output from table(dbms_xplan.display('plan_table',null
,'basic'))
Plan hash value: 2137789089
-----------------------------------------------------
| Id | Operation | Name |
-----------------------------------------------------
| 0 | SELECT STATEMENT | |
| 1 | COLLECTION ITERATOR PICKLER FETCH| DISPLAY |
-----------------------------------------------------