what is explain plan?, given an example...
Answers were Sorted based on User's Feedback
Answer / shivainduja
An explain plan is a representation of the access path that
is taken when a query is executed within Oracle.
SQL> explain plan for select * from emp2;
Explained.
SQL> select * from table (DBMS_XPLAN.display);
PLAN_TABLE_OUTPUT
-------------------------------------
Plan hash value: 2941272003
--------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost
(%CPU)| Time |
--------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 15 | 570 | 3
(0)| 00:00:01 |
| 1 | TABLE ACCESS FULL| EMP2 | 15 | 570 | 3
(0)| 00:00:01 |
--------------------------------------------------------------------------
8 rows selected.
| Is This Answer Correct ? | 4 Yes | 1 No |
Answer / rajesh venati
this will also work.
An Explain Plan is a tool that you can use to have Oracle
explain to you how it plans on executing your query.
ex:-
SQL> set autotrace on explain
SQL> select * from emp;
Execution Plan
----------------------------------------------------------
Plan hash value: 3956160932
--------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost
(%CPU)| Time |
--------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 14 | 518 | 3
(0)| 00:00:01 |
| 1 | TABLE ACCESS FULL| EMP | 14 | 518 | 3
(0)| 00:00:01 |
--------------------------------------------------------------------------
| Is This Answer Correct ? | 1 Yes | 0 No |
Explain Plan determines the execution plan of SQL statement.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is memory optimized table?
What are the key differences between SQL and PL SQL?
What is difference between % ROWTYPE and TYPE RECORD ?
what are the differences between binary and varbinary? : Sql dba
Can we insert data into materialized view?
What are three advantages to using sql?
What are the types of sql commands?
SQL Tuning, Oracle Server 10g: Why is the following hint invalid? SELECT /*+ first_rows parallel(table_name,paral_number)*/
Why are aggregate functions called so?
Which query operators in sql is used for pattern matching?
Is full outer join same as cross join?
What is sharding in sql?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)